To expand on the both excellent answers by mattdm and Caleb, I should add that depth of field is distinct from background blur. This means that if the image is printed / viewed as small, there can be more acceptably in focus than what is said by the depth of field.
Given equal framing and maintaining the same camera crop factor, depth of field is proportional to F-number, and background blur is proportional to focal length divided by F-number.
There is one and only one strategy to increase the depth of field given equal framing, assuming changing crop factor of the camera is not an option:
- Increase the aperture F-number, i.e. stop down
Focal length does not affect depth of field if you move closer or further away to keep equal framing at the same time focal length is changed.
Now, if you want to both maximize depth of field and minimize background blur given equal framing, you should also:
- Decrease the focal length (zoom out) and walk closer to the subject
Sometimes you cannot do (2) while at the same time maintaining the F-number, because the maximum F-number can vary depending on the focal length of a zoom lens.
For example, with a slightly stopped down 24mm f/2.8 crop lens (equivalent to slightly stopped down 38.4mm f/4.4 on full frame camera), nearly everything is in focus and those elements that are out of focus don't have much blur, unless the subject is VERY close. If you are not satisfied with the results, stop it down more.
On the other hand, on a 85mm f/1.8 crop lens that has not been stopped down, the depth of field is very small and the out-of-focus elements are very blurred.
These strategies can be used to your advantage if you want everything in the subject to be in focus (acceptably large depth of field), and background blur to be large at the same time. For example, for portrait photographs, it may be better to use 85mm f/1.8 crop lens and stop it down a little than to use 50mm f/1.8 crop lens wide open, to have good depth of field AND desirable background blur at the same time. Of course, this means you need to step back and can hit a wall in the process if shooting indoors!
Oh, and when stopping down, you need to compensate it somehow in exposure:
- Use a flash, if feasible, but this may not be feasible if the subjects are very far away
- Or increase the exposure time, while at the same time using a tripod or image stabilization, if feasible, but this may not be feasible if the subjects are fast-moving