Moving the camera and lens as a unit works well at high magnifications. At lower magnifications, the high road is leaving the lens still and moving the sensor. But that requires special equipment. Moving the lens and leaving the sensor still is a decent compromise.
The scenario I described is a bit of a test of the camera's autofocus / available focus aids / the user's skill.
To repeat, that scenario was photographing a static object 3m away at 135mm f/2 on an FF camera. Depending on your personal idea of depth-of-field, this scenario might imply a depth-of-field of something like 3-5cm. The field-of view in the plane of focus will be about 0.8m x 0.5m, so magnification is about 1/20.
If we'real picky about focus in this scenario, we can mount the camera in the middle of the travel of a macro rail and then focus.
We can probably confirm we're close to the focus we want by taking a picture, and checking the magnified captured image.
If we now lock the focus (assuming that's possible with a modern fly-by-wire lens) we can maybe divide our depth of field estimate by - say - 10, and use that distance as a step between half-a-dozen macro rail positions either side of our initial position on the rail. Then either focus stack, or choose whichever looks best.
I think Jim Kasson wrote some stuff about the effect of defocus on MTF.
It may involve no calculations by you, but that is because they have already been done for you by the person who worked out where to put the DoF scale marks on the lens.
Just the same as using a DoF table. You look up the value in a table for which someone else has done the calculations.
Just the same as using a DoF app. You read the result after the computer does the calculations for you.
All DoF calculators assume a value for Circle of Confusion (CoC). The equation is DoF is approximately (2 u^2 N CoC), where u is distance in number of focal lengths or actual distance divided by focal length, N is f-number and of course the CoC. The CoC is a subjective value having to do with human visual perception and it varies depending on how the image is viewed. If one pixel peaks at 100% the CoC will be on the order of just a few pixels. If the image is viewed on a display at a normal viewing size and distance, it will be different (and larger than for the pixel peaker). If one prints it will be different still.
Personally, I rely on 50 years of experience with multiple camera formats from APSC to 4x5. I might add I also consider the final display of the image is the fine print. If one is wants to pixel peak, the DoF will be very small unless one goes into the zone of diffraction limited where nothing will be really sharp.