I thought it may be useful to write a bit on focus stacking, since I do more of it that most.. I think there are 3 types.
1. Studio focus stacking
2. Field focus staking with tripod
3 Field focus stacking hand held
I know very little about 1, a bit about 3 and a lot about 2. So I'll concentrate on 2.
2. Field focus staking with tripod
This can only be done with stationary subjects. For example fungi, lichen, moss, some insects, or any other generally inanimate subjects.
The key to good focus stacking like this is speed. If you plan on taking several minutes for your sequence, you will have a very high failure rate. You need to balance the various opportunities to improve resolution and light quality against the time taken the get those improvements.
Lighting. While the strongest light is either sunlight or flash, it does not make the best pictures. Flash can be good if you are a lighting expert and you are willing to carry studio equipment around with you (multiple light sources, multiple reflectors and shades, etc), but even then good natural lighting is usually preferable. The first problem with good natural light is that it is almost always less intense that sunlight or flash, and therefore requires a longer exposure, but it gives beautiful results. I spend as much time searching for the right light as I do searching for the right subject. Bright sunny days with harsh lighting are not very good for macro photography, nor are lightly overcast days with very flat lighting. I find that the very best days for macro photography (and other sorts too) is when it is heavily overcast or even raining, though rain isn't an easy environment to work in. Lighting is generally one of the major components to any good photography as it can change the contrast and colour. It can make the hairs on a subject stand out without making them overwhelm. It can make the difference between a wow subject and yet another ordinary one. It may be technically good to show every detail on a macro, but it is something special to show every little detail AND have a beautiful picture as well.
Aperture. While to get the very best from studio focus stacking, you may want to use f8 or less, this is generally not true in the field. The reason for this is that things change in the field. The light can change, or the wind, or your tripod can move, or an insect can decide to move, etc. While you need to select a "field studio" to take your shot, it is still in the field and therefore open to the vagaries of nature. I use f16 on my current camera (a Sony A7R3) and f18 on my older cameras (about 20MP full frame cameras) or F16 on an APSC 20MP camera. Most people will tell you that this is far to high as you get significant diffraction effects, but I have experimented and found the net effect to be quite small. The "net" effect includes improvement in resolution due to lens effects which tend to balance the loss of resolution due to diffraction effects. If I use a lower fstop then I have to take more photos to complete the stack and I run the risk of something changing or missing the focus at some point. Focus stacks look terrible if there are patches that are oof.
Also, if you use a low fstop you will probably need to use a focus rail, and a good one. With high fstops, a small move of the focus ring will change the focal plain by enough for that fstop, but will probably be too much for f8 or less. If you opt for a focus rail it will need to be a good one, like RRS, as cheap rails wobble a bit and are usually useless for fine work like this. A focus rail is "better" than using the focus ring as using the focus ring changes the focus and the magnification, which means that you will lose a bit of resolution in the final stack. But, the compromise is usually worth it because it saves a lot of setup time and an extra piece of equipment. If you use the Canon MP-E lens, you will have to use a macro rail as it has no focus ring.
Shutter speed and ISO. Most of my field macros are taken at 1sec or more (often 5-10 secs). Once you have decided on an aperture there are only two ways that you can vary the shutter speed.
1) Changing the light. It is always good to get enough light on the subject and in the right places. If the light is dim or shaded in critical places you can use reflectors to modify the light. With macro, this can be a piece of white paper or aluminium foil. Both are very easy to carry.
2) Changing the ISO. This is camera dependant. I will go up to ISO800 on my Sony camera which gives a slight increase in noise but allows 1/8 of the shutter speed compared to ISO100. If the shutter speed would be 30 secs at ISO100, then it will be 4 secs at ISO800.
Keeping the camera steady. This is important with all long exposure photography and particularly important with multiple shot photography. Between each shot you will usually need to touch the equipment, usually to change the focus. This introduces the possibility of moving the camera between shots, so a good tripod on a firm foundation is essential. Activating the shutter is also a danger point for movement. I use a remote shutter release, which eliminates this. If you don't have that then use a timer release, so as to let the camera settle before activating the shutter. Where possible use electronic first curtain to eliminate mirror slap, if it is a problem with your camera. It is worth noting that most focus stacking software can tolerate small movements of the camera (a few pixels) with little problem, though large movements are hard to compensate.
Equipment.
A camera with a macro capable lens. I use a Sony A7R2 and A7R3 with a Sony 90mm G OSS macro as my preferred camera, but I have also used a Canon 7D2, 5D3 and 1Ds3 and the Canon MP-E with all cameras.
A good tripod that can hold the camera steady across multiple shots. Many cheap tripods will not do this. I use a Gitzo tripod, but I'm think that there are cheaper tripods that will work.
Some stacking software for post processing. I use Helicon Focus but there are others that are cheaper. You can do it manually using Photoshop layers (I did this before the software became available), but it is a lot of work and I wouldn't recommend it.
I've attached some examples of Field focus stacking with a tripod. I will sometimes do upward of 100 of these in a day, so time taken is very important.
Cookeina tricholoma. You will note that the white object on the back branch (bottom right of fungus) loses definition on the hairs. This is one of the challenges of focus stacking. It is impossible to get both an overlapping background and foreground perfect.
Plectania campylospora