A QUICK TIP…
You probably realize that a small aperture will provide you with the most depth-of-field, but stopping ALL the way down to your smallest aperture (usually the largest number, i.e., f/16, f/22, etc.) is not typically a good idea. Many lenses perform best at one or two stops shy of their smallest aperture. As you stop down from there, performance suffers. This is because of diffraction.
Sometimes you need more depth-of-field and when you do, you have no choice but to stop down (or focus stack at a larger aperture, but that’s a topic for another day.)
It’s okay to stop down when you need to, but just keep in mind that stopping ALL the way down will usually degrade image quality.
Simply put, diffraction is a phenomena that occurs with light when it interacts with an obstacle. (You’ve probably seen light diffraction patterns on the backs of DVDs, or in water molecules in the air.) If you stop all the way down to your smallest aperture, diffraction can cause your images to lose their sharpness.
Just keep it in mind when you’re choosing an aperture.