If you have a high end DSLR (or one of those Sigma USB docks), you might not know it, but you have the ability to adjust how your lenses autofocus. If you find your photos consistently having the problem where the focus is either to the front or back of where it's meant to be, you may need to tweak the autofocus microadjustment, and Canon has put together an excellent guide to this feature on the Canon Knowledge Base.
While the guide is a bit long in the tooth (it's from 2011), and is specific to Canon cameras. But the discussion of the techniques and technology being used to tweak the AF are universal enough that they also apply to just about any camera with microadjustment functionality. The article discusses how to spot that it's happening, and how to begin the process of fixing it—be it for the the camera as a whole, or just for a specific lens.
The one thing we would add to this guide is the usefulness of using a dedicated lens calibration chart. If you want to get super-accurate about it the Spyder LensCal and LensAlign charts are both excellent options if you're willing to pay. There are also free alternatives, which would probably do the job for most people (assuming you have a sufficiently good printer), like this one from Jeffrey Friedl, or this one from Squit.co.uk.