It’s important to keep the camera as still as possible during the exposure. (See ‘Beat the shakes’ at the top of the page for how to minimise mirror bounce.) A sturdy tripod is all but essential.
Narrowing the aperture to around f/11-f/16 helps to eke out a little extra depth of field. Going to very small apertures of f/22-f/32 can cause a lack of sharpness due to diffraction (see Jargon Buster, opposite).
Most current Nikon cameras have sensors capable of capturing incredible levels of detail, so make the most of it. By shooting from slightly further away and cropping the resulting image, you can get a much greater depth of field.