This question already has an answer here:
The scene is at the distance of say 10 feet. I own Nikon d7200 and a lens of 18-140 mm.
There are three cats here and there (not together), but many of my images focused on one/two cats and not all because the third one was a bit away from the rest two. In other photo, the camera focused only on that isolated cat and not those two.
I need the solution that all three cats are focused, surrounding is focused, and nothing is blurred.
Out of many photos, only a few focused on all the cats and background. But I wanted almost all of them to be like that.
For reference, check this photo. This is one of them what I wanted. But in other photos, all the cats were not at one place. That's why the camera focused only on one/two cats. The background is just a wall, a plain wall. So, no depth of field is to be worried about.