this depends upon the camera model
the latest Nikon cameras have an automatic mechanism for performing this
some photographers use commercial software to assist such as:
others use a flat focus target they download or create as one needs to be able to accurately assess the auto focus - preferably with the focus target at the usual focus distance which the user shoots for that lens
set the camera up on a sturdy tripod
set the focus target at the desired distance and is perfectly parallel to the camera
take 5 shots at each calibration setting then either use commercial software, or you eye to assess which of the calibration settings gives the sharpest results - you probably should start at main large increments of calibration to get you to the ball park, and then re-test at +/-1 or +/-2 calibration points around the best point
On Olympus OM-D cameras (you probably only need to do this when using Four Thirds lenses):
Menu: Cog K (Cog A2 on the E-M1 II): AF Focus Adj: Lens Data
you can the manually adjust each of the AF points for the attached lens (the E-M1 II allows setting both Tele and Wide calibrations at each point when using a zoom lens)
if you don't want to use these settings, set AF Focus Adj to OFF.
-