With photos you will only show on the web, or as small prints, a high level of sharpness isn't something most people need to care much about. But it can be very dissapointing to take a great shot with a quality DSLR camera, get it printed at 8 x 10 or larger, and see that the details you assumed would be tack sharp, are all a bit fuzzy. And if you want to take your photography to a more professional level by selling prints yourself, or by submitting photos to on-line print-selling sites, then, at least with most subjects, ensuring you make the sharpest possible image is a real necessity. Following these tips will get you a long way towards getting perfectly sharp photos that can be enlarged to almost any size print and still look stunning.
One important thing to keep in mind is that the number of megapixels a camera has is a big factor in camera marketing, but it's pretty meaningless for serious photography without good technique to take advantage of the higher resolution. A well-shot picture using a 6 megapixel camera will easily look much sharper than the same image taken with a 20 megapixel camera, but poorly shot. If there are flaws in the exposure, no amount of pixel density will hide them.
1. Use a tripod or a high shutter speed.
For some types of photography, using a tripod isn't practical. When you have to take shots hand-held, always opt for a high shutter speed. The general rule is to use at least the focal length of the lens. My Canon 28mm lens works out to about 45mm actual focal length on my T2i Canon DSLR camera. So in theory I should use a minimum shutter speed of 1/45 sec. But in practise, today's cameras are so light that they require even higher shutter speeds to prevent camera-shake that will show up in printed enlargements. So I go up to at least 1/250 sec. with that lens if possible, and preferably higher if I can also keep the aperture stopped down at least one stop. (An aperture of 5.6 - 11 is optimal for most lenses. But I consider high shutter speed at least as important. Still, it's advisable to have the lens stopped down at least one stop whenever possible.)
Unfortunately, unless you have rock-steady hands, posture, and breathing, even at that fast shutter speed you will often see some camera-shake when you look at the image at 100% view on your computer screen. It may be only visible at 100%, but when you know what your camera is actually capable of at 100% view, it will be clear as day. In sports or action / street photography, some minor blur may often be acceptable. But in any other kind of photography, it can be avoided - by using a tripod.
A tripod also allows you, in many situations, to set your lens at its optimal aperture for sharpness, and then use whatever shutter speed is necessary - even minutes or hours.
2. Use a cable release.
You can use a tripod without one, but a cable release makes it all easier and more secure in eliminating vibrations. As long as you are touching the camera when you trip the shutter, small vibrations will occur, and at slow shutter speeds faster than a few seconds they will definitely show up. A cable release lets you set up the shot, wait a few seconds for all possible vibration to stop, then trip the shutter electronically without touching the camera at all. You don't need a fancy remote-control one, and they are relatively cheap.
3. Use mirror lock-up.
Even without touching the camera when you trip the shutter with a cable release, there will still be some vibration caused by the camera's mirror when it flips out of the way just before the diaphragm opens and the exposure is made. A good DSLR camera will have an option to set so that the mirror locks up when you trip the shutter; then there is an automatic 2 second delay before the picture is taken, which should be enough time for all vibration to have ceased. You should also have the option to lock the mirror up with one position of the cable release, then wait as long as necessary to be sure there is no vibration at all from any source - including wind - before setting the release to the 'full' position (or clicking a second time) and taking the shot.
4. Shoot in RAW format.
This point is probably worth doing some research about your particular camera, and even some testing. But in general it's a good idea to always shoot in RAW format, for a couple of reasons. JPEG format produces smaller files, and may look quite good, but it is not a "lossless" format. Every time a JPEG file is saved - including when the shot is taken - there is some compression - and loss - of image information. When you process the shot in your photo-editing software, and save it to JPEG (which many on-line sites require), you are compressing even more on an already compressed image. So 90% of the time you are losing image info. at least twice over.
A JPEG image also has some sharpening applied in camera, and it may well be that your computer photo-editing software is capable of much better sharpening than the in-camera process.
Finally, whatever post-processing you do with your photo-editing program, including sharpening, it will have the maximum, and most accurate image information to work with if it's dealing with a non-compressed "lossless" format such as RAW or Tiff. All of these factors have an effect on the amount of sharp detail visible in the final image, as well as other factors.
5. Learn to use the sharpening tool correctly.
If you shoot in RAW format, the images will need some sharpening. Don't just hit 'Sharpen' in your editing program and think you're done. Sharpening an image with photo-editing software is an art in itself, especially if you get caught up in the search for perfection in post-processing. My advice here is to spend some time just learning how the basic "sharpen" option works, and stick with that until you have it down, rather than trying to learn every possible variation.
First, make the sharpening process the very last thing you do after all other adjustments, including final resizing of the image. Then check out the results of sharpening at 100% view (no more than that), then 75%, 50%. Keep sharpening and checking different view ratios until it's obvious that you have sharpened too much. After doing a few images, you'll soon have a good idea of how much you typically need (one pass, two, or more) depending on the image. Be aware that what looks good in one small (100% view) portion of the image may change the overall view of it in a different, unwanted way, and that pictures are not meant to be viewed at a distance of 2 inches. If unsure, it's best to err on the side of too little rather than too much. If you are sharpening a RAW / Tiff image that has had no sharpening done in camera at all, the improvement will usually be quite dramatic even after just one pass.
6. Expose for the highlights.
Currently, digital cameras are better at retaining detail in shadows than they are in highlights, and overexposed highlights with little detail do nothing to add to the image's overall appearance of sharp focus. So it makes sense to expose for full highlight detail, then bring up the shadows in post-processing. Some cameras have the option to set the amount of contrast in the exposure. Setting your camera to take low-contrast exposures, especially in bright sunlight situations, will make it easier to retain all detail in both highlights and shadows. You can then adjust contrast up or down with editing software later.
7. Check the quality of your lens.
Finally, do some research into the quality of the lenses you use. Many excellent cameras are sold with zoom lenses that are ok for casual snapshots, but decidedly inferior to fixed focal-length lenses, or to much better quality (and much more expensive) zoom lenses. This keeps the price down in a very competitive market, and adds the attraction of a zooming lens as part of the basic package, but it's often at a real sacrifice of quality for serious photography. You may find that even though the zoom that came with your camera is not too bad, you can still improve things quite a bit by buying a fixed length lens for not much more than the price of the standard zoom lens. For example, I have a 50mm Canon lens that sells for around $100, or quite a bit less in some places, and is one of the sharpest normal (non-FL) lenses Canon ever made.
With a good lens, and using the tips above, you can take full advantage of your camera's potential for beautiful, super-sharp photos at practically any size of enlargement.