At high magnification, specially for focus stacking, one needs to avoid any movement of the camera by accident in-between frames. For Nikon you have various options, from most expensive to cheapest, and all of them effective: a motorized focusing rail (e.g. Stackshot from Cognisys, or a similar one from Weemacro or the very expensive new Novoflex one), a focus-staking extension tube from Helicon Focus, a Remote controller specific for stacking running on a computer or cell phone, such as Helicon remote, any other camera tethering software that allows remote manual focus.
With the motorized rails you can use any objective, even microscope objectives, and extension tubes without electronic connection. Macro photography using tethering or remote control without a rail, either through USB or Wifi will require a lens with autofocus and extension tubes with electronic connection to the lens.
Earlier I used quite frequently for focus bracketing with my Olympus camera a free tethering software from Olympus, that lets me manually step the focus point frame by frame, tedious but it works. Surely there are equivalent software for Nikon (even Lightroom or Capture One might work).
Recent Olympus cameras can be programed to do focus bracketing with many steps, and this is easy and very fast and what I tend to use nowadays. Some years ago when using a Nikon D7000 I found Helicon remote to be handy to control focus in camera or the Stackshot rail to do focus bracketing. All in all much depends on the magnification you aim at, at moderate magnification even manual focusing rails can be used with care and patience if the camera is on a sturdy copy stand or heavy tripod (macro rails like those from Sunwayfoto's or Really Right Stuff are good for this). As told in other answers, you can use such rails also to get the distance to within the range where autofocus or manual by wire focus will be in range.
For a whole system of modular rails, bellows, etc. Novoflex has the most comprehensive and unified approach, and they have added quite a few interesting new pieces of equipment in the last year, but at very high prices. Other supplier is Hejnar photo also makes a large array of different high precision manual focusing rails.
I mentioned above different brands as examples of what are the options. There are other alternatives that may be better or worse, cheaper or more expensive, but the companies I mention have web sites where the equipment is clearly described.