SOLVING FOCUS ISSUES
How many of you reading this have ended up deleting images because the auto focus missed? I should imagine just about all of you at some point. I know I have. If the subject matter is moving quickly, you can almost accept the fact but, when you start missing focus frequently or on static objects and posed portraits, it becomes extremely frustrating.
Often, our first reaction is to blame the lens or camera because it couldn't possibly be due to anything we are doing, right? The reality is that more often than not though, focusing issues stem from human error and not the equipment itself. However, that's not to say that your lens isn't faulty and I will address this first.

If you persistently get out of focus photographs, then it is possible that you have a defective lens. Generally, manufacturers have pretty good quality control but, it's not impossible for some to slip through the net. There are also what are regarded as "acceptable tolerance" ranges and provided a lens falls within these ranges, it is regarded as fine. However, problems can still arise between individual lenses and cameras.
For example, let's say the acceptable range for both your camera and lenses was +3 to -3 and you have a lens at -2 and camera at +2, they would effectively cancel one another out and you'd have no noticeable problems. It is when you get double negatives or double positives, that you can end up with either forward or back focus issues. So how do you know if this actually the case?
Thankfully there is a test you can perform to identify the problem and even tools you can buy or even make yourself to help you perform it. I personally use the Spyder Lenscal. Not the cheapest option available but, if you have numerous lenses it does come in very handy and allows you to calibrate any future lens purchases too. Cheaper options include downloading a free profile chart which you print out. If you don't have a printer, then this isn't much use to you, so I will tell you how to do a low-tech version of the test, which is still very effective.
You'll need the following items:
Ruler - preferably white with black markings, or vice versus. This will give you the best contrast and assist in focusing. If all you have is a clear plastic ruler, put a sheet of white paper beneath it, to help the numbers and lines stand out.
Tripod - this will allow you to tilt the camera at 45° degrees and have a stable platform for focusing.
Shutter release cable - this will enable you to focus the camera without touching it and give you more accurate results. It is very easy to put pressure on the tripod head, when focusing, which which will alter the tilt angle and thereby shift the focus plane. This is something we do not want happening as it will affect the results and may provide false positives.
Light - whether you use ambient or flash to illuminate the ruler, you need to ensure you have a good amount of light to assist focusing. If the room is too dark, then the lens may hunt or struggle to find its intended target. In my view, a monolight is the best thing to use, as there is a flash to freeze action and a modelling lamp to assist in focusing.
The Test
To perform the test you will need to set the camera up on the tripod and place the ruler on a table or other flat surface. The floor will work just fine, provided you can get your camera low enough. Next you will need to angle the tripod head at 45° degrees. Move the camera so that the centre focus point is on the middle of the ruler. If it's a 30cm rule, aim for the line that corresponds to the 15cm mark. If it's a shorter rule, just aim for the middle number. You will have to ensure that the camera isn't inside the minimum focusing distance of the lens. Some lenses can focus very closely, other's have a much longer minimum focus range. If you're 25cm from the target and the minimum of the lens is 30cm, then the camera won't be able to focus.
Whenever I perform this test, I like to set the lens to the closest focus, then move the tripod until the target is in focus. I then move it back a couple of centimeters and raise it up slightly, so it's still on the target but, there is a bit of leeway for the lens to auto focus. Attach your shutter release cable. This will enable you to focus without putting any force on the camera or tripod and shift the focus plane. In the camera settings, enable the mirror lock-up or exposure delay mode (it's the same thing named differently depending upon manufacturer) as well as the timer. This will help prevent vibration from mirror slap. Set your lights up to ensure you have enough to focus with and get a blur free image. You may want to raise your ISO up a couple of stops above native if you are doing this completely by ambient light, to give yourself a good shutter speed.
If your lens has any form of image stabilization (VR, VC, IS, OS) disable it. On the camera body, set the lens to the maximum aperture. This will give you the shallowest depth of field and allow for more precise analysis of the photograph. You don't want a very deep depth of field like f/16, as you won't be able to tell where the focus is landing. You could have it set to this aperture previously, so ensure you open the lens to its widest. You are now ready to take the test shots. Be aware that if you have a zoom lens, you will need to perform this at both the wide and telephoto end. It is possible for a lens to focus correctly at one extreme and not the other, so be sure to check each one.
Analysis
You can review the images on the LCD screen or on the computer after the fact. If the focus point has landed where you aimed it, then the lens has no focus issue. If the focus landed further or closer than the intended point, then you have either a front or back focus issue.
Provided your camera has an AF fine tune adjustment, then you can attempt to correct focus issues. This is best done at the time of shooting, making small adjustments after each shot and comparing the differences between previous shots. If the defect is severe, then the AF fine tuning won't be enough and the lens will need to be recalibrated by the manufacturer. If the problem occurs on a zoom lens, then you are out of luck as you cannot correct for both ends of the zoom unless you area Canon user. The 5DMKIII is able to correct both ends of the zoom range. Currently no Nikon models feature this. Not all cameras have AF fine tune, either. It is mostly absent from entry level DSLR and means there is nothing you can do to solve the problem yourself. You will need to return the lens.
Once we have eliminated any hardware issues, we can determine that the fault for out of focus images lies with ourselves. This can either be inappropriate settings used on the camera or poor technique. The most common reasons are :
Wrong focus mode - Your camera typically has 3 automatic focus modes, as well as the option to do so manually. The first is single shot. This is where the camera will focus upon a subject and once locked on, you are ready to take the photograph. This is suitable for static subjects, like landscapes, still life and posed portraits.
Next is continuous focus mode. In this setting the camera will constantly track and focus upon your subject to keep them in focus. This is ideal for moving subjects. However, whilst this mode is the best for moving subjects, the success rate of maintaining focus on a moving target will depend upon how fast the subject is moving, the direction it is moving in and the focus speed of the lens. For example, if you are photographing a racing car which is driving directly towards you, your lens will have a much tougher job, than if it were travelling perpendicular to you. Professional lenses usually don't have much of a problem because they are designed to be fast. Kit lenses don't tend to enjoy the same luxury, often being much slower to focus.
Lastly is a hybrid mode which jumps between single and continuous focus, which uses the camera's computer to decide which focus mode is best for the given situation.
Wrong AF Area Mode - Along with which focus mode to use, is the automatic focus area mode. Getting this wrong can be just as disasterous to your image results. Nikon has three different AF area modes. Theres are Single Point AF, Auto Area AF and Dynamic Area AF. Other manufacturers have their own version/names for it.
When your subject is static (landscape, still life or posed portrait) Single Point AF is normally the best option. It ensures that the most crucial elements in the frame, such as the eyes of a portrait, will be sharply focused.
Auto Area AF is designed for beginners who might not be fully proficient with selecting focus points themselves. This mode uses color information and complex facial recognition algorithms to detect and automatically focus on an individual’s face. This AF area mode is also very useful when the shooter simply doesn't have the time to select a focus point, or when utilizing the Live View in hand-held mode at low or high angles.
The Dynamic Area AF is specifically designed for shooting moving subjects. The photographer can choose between one of a few focusing options. Depending upon the model of DSLR you are using, 9, 11, 21, 39 or all 51-points AF can be activated. Simply select a single AF point and the areas surrounding it serve as backup. If your subject is moving somewhat erratically, selecting 9 AF points to be active will provide greatest accuracy. If your subject is low in contrast opting for 21 or 51 points makes for faster, easier detection. If you select the 51-point AF area option, you can also use the 3D Focus Tracking feature, which uses color information from the RGB sensor to automatically follow moving subjects across the AF points.
Wrong Release Priority Mode - There are up to 3 options, depending up with focus mode you are in, as to the priority given to taking an image. These are "Release", "Release + Focus" and "Focus". When the "Release" option is selected, photographs can be taken whenever the shutter button is depressed. This is regardless whether or not your image is actually in focus.
When "Release + Focus" is chosen, photos can be still be taken even when the camera is not in focus but, if shooting in continuous mode (burst), the frame rate slows for improved focus chances if the subject is dark or low contrast. "Focus" prevents the camera from taking an image, if the in-focus indicator is not displayed. This will ensure your images are in focus but, may mean you miss capturing the moment if your lens is not quick enough, or the AF is hunting.
Single or Continuous (burst) Release Mode - If your subject is moving, you can greatly improve your chances of nailing focus and the critical moment, by taking multiple shots. For portraits, a single shot per depressing of the shutter release is often sufficient.
Low light - In order for the camera to focus, it needs to see, just like we do. If it's too dark, the camera will be unable to lock on target and the lens will continue to hunt in vain. If you are shooting in low light situations with a kit lens, which typically has a full zoom aperture of f/5.6, you may have less success focusing in darker conditions than a professional f/2.8 or wider aperture lens.
Low contrast - Even in bright conditions, if your subject lacks contrast, the camera's auto focus system may be unable to lock on. Point it at a white ceiling or wall, you'll probably notice the lens hunting and cause out of focus images.
Depth of field - If you are shooting with a wide aperture lens or at very close distances, then the depth of field can be very shallow. Sometimes this can literally be 1mm before things begin falling out of focus. In such instances it is critical to nail focus perfectly and very easy to land slighting in front or behind the intended target. While it can be a nice attribute of a photo to have the eyes solely in focus, unless your subject is stationary, I'd recommend using a deeper DOF to ensure you get more of your subject in focus. For example, I rarely shoot below f/4 with the 50mm f/1.8D when photographing children, mainly because they move about to much and you give yourself a MUCH harder time, trying to shoot wide open.
Timer/Exposure Delay - This is my favourite mistake. If I've been using the timer on the camera, I always forget to reset the camera to normal shooting mode. Often the timer is used in conjunction with the exposure delay mode. If you've been taking long exposures of landscapes or still life, then the chances are you enabled this feature, to safeguard again mirror vibrations. What will happen is you press the shutter release and the camera will wait a few moments before taking an image. By this time your subject may well have moved outside the focal plain, resulting in an out of focus image. Always try to remember to reset the camera before shooting, although I admittedly am guilty of this one myself quite often.
Focus and recomposing - This technique, while very handy, isn't without its issues, particularly when shooting with a very shallow depth of field. The problem is a result of shifting focal plane when recomposing. Looking at the diagram below left, you can see where the focus has landed on the eyes, exactly where we wanted it to be placed. However, when we recompose the shot to place your subject on the left or right hand third of the frame, you shift the focal plane too. This in turn means that focus falls behind the eyes and a miss focused image. When shooting at higher apertures (f/11, f/16, etc), this technique is not an issue because the depth of field is sufficient to keep the eyes sharp and in focus. This example highlights that focus problems can simply be as a result of bad technique, so check yourself before you blame your gear.