There are only a few things that cause focus issues.
1. Using more than one focus point. The camera then picks which one it wants to use and the camera will choose the one where there is the most contrast. Chances aren't really great that it's going to choose the focus point YOU would choose. Especially when you have cameras that have a lot of focus points. Your odds decrease pretty quickly for hitting the right one.
In this lovely image of my Lilly I used all 19 focus points on a 7D. The camera liked that window behind Lilly because it has such a nice contrast to it. I had odds of 1 in 19 of getting the camera to
Choose the focus point YOU want and lock it onto the place you want it. Remember to be aware of contrast!!
Here's Lil when I chose where the focus point landed.
2. shutter speed too slow-Shutter controls motion blur. If your shutter speed is too slow for either your hand to hold the camera without shaking or the subject moves, motion it will show in the image as blur. Someone asked me how I determine if it's motioin blur when I look at an image and I didn't really have the best answer for her. I said something like it makes you feel like your eye moves. I think I've gotten a better explanation: It looks like a vibration in the lines of the image. Look close here at Lilly's cage and you can really see what I mean by vibration. That, and her eyes also look drunk. My shutter here was 1/13.
3. Aperture too wide or close distance with wider aperture. Aperture and distance from the camera to the subject (both in feet and in zoom) control depth of field or how much of the image from front to back is in focus. If you are using a wide aperture you may have a fraction of an inch of sharp in the image. If you are using a narrower aperture and shooting close (either by your camera being physically close OR by zooming in close) you will have a much smaller depth of field. So, if you are using say f/4 and think you should have DOF, but you are 3 feet off the subject that DOF just dropped to nearly nothing.
Meet Harley. I was about 3 feet from Harley with a 70-200 lens shooting at f/3.5 zoomed into 200mm
Here's a larger view of where my focus landed. Remember up there when I said be mindful of contrast? I didn't do that here and look where it landed. Much better contrast there than would be in Harley's eye.
Had I used a larger aperture such as this one of Jack at f/8; 3 feet and 200mm I would have gotten enough DOF to accommodate where the contrast grabbed my focus point:
4. Back or front focusing lens or a camera problem. Lenses can get knocked out of perfect calibration. Google and try a "back focus test." This is the 2% of the time that it's not the user's fault