I started with 5 images of the same subject with the focus set on a different plane for each one. My camera was the Canon 5D with Tamron 180mm macro lens. Settings of 1/30 of a second and f/5.6 on a tripod.
Selected the 5 images in Lightroom… right clicked to Edit In > Open as Layers in Photoshop. Photoshop will open one file with each image as a separate layer. Now Edit > Auto-Align Layers (making sure you have all 5 highlighted).
For further blending use Edit > Auto-Blend Layers.
Then I Flattened the layers and made a duplicate of the final layer. To sharpen Filter > Other > High Pass and use a value that shows the edges of your subject and set the blend mode to Soft Light. That layer will be gray, no worry! Just flatten with the layer below.
Here’s another from 3 images: