How many times have you taken the most amazing picture in your life, only to find out later that it is out of focus and blurry? It happens to everyone, even the pros. There are several different reasons that this happens and many tricks to help make it better. You can always try to add some sharpness on the computer later, but it often degrades the quality of the image and never quite does the job. The best bet is to take a sharp picture from the start.
Reason #1: The camera was too close to the subject of the photograph and could not focus. If you like taking really close-up pictures of objects or people you may often find them out of focus. All camera lenses have a limited focusing distance, and it is important to know what yours has in order to avoid this problem.
Solutions: Take a step back. Just back up a little until the camera seems to focus better. You can always crop the picture later on your computer for a close-up effect. If you have an SLR with interchangeable lenses you can buy lenses with a very small focusing distance, or buy close-up filters that work as magnifiers for your lens. Also, try buying lenses with a macro option. Even point-and-shoot digital cameras often have a macro setting; the symbol will probably look like a flower.
Reason #2: Camera shake during a slow shutter speed. In low light conditions the camera needs to keep the shutter open longer to make sure the captured picture is light enough. A camera does not view light like the human eye does, so even though you may be able to see perfectly clear, the camera can have trouble capturing the image. The camera must be absolutely still during the entire time the shutter is open, or else the picture won't be sharp.
Solutions: Support the camera so it can't shake. The best way is by using a tripod, but if one is not available, you can use any solid surface for support. This might be a counter top, railing, or even lamppost. Some people have a more steady hand than others, but even so, it is less reliable than a sturdy, inanimate object. Another option is to increase the light in the picture so that the shutter does not have to stay open so long. This can be done by using your flash, turning on more lights in the room, moving near a window, etc.
Reason #3: The auto-focus chose to focus on something other than the subject. This is probably the most common reason for pictures being out of focus. The camera may decide to focus on the background instead of the person in front of it, or an object on the table in front of the subject.
Solutions: You can specify which auto-focus point to use. The more advanced the camera is the more points there will be, but even on simple point-and-shoots you usually have at least three to choose from. This will help get you closer to the subject. You can also focus directly on the subject, and then reframe the picture by moving the camera so your subject is where you want it. Be careful not to move the camera further or closer or to change the angle, or the focusing plane will change as well. Canon has now introduced a "face detection" feature in its cameras that will actually find human faces in the shot and focus on those.
There is one final option that can be applied in almost any situation. Take a lot of pictures. If you take several pictures of your subject you have a higher likelihood of getting at least one nice and sharp and in focus. Especially with digital cameras now, you can just delete the bad ones later. Remember though not to rely on your digital LCD screen to tell you what is truly in focus. The resolution and size of those screens is too small to really see clarity, you won't know exactly what is sharp until you see it enlarged on a computer screen.