In both photographs below, the camera was focused on the bottom edge of the book.
Note how the title is out-of-focus when the lens opening is at f/4.5.
Wide lens openings, such as f/4.5, have less depth-of-field.
Not as much is in focus.
The book is more in focus in the right photograph.
The small lens opening, f/22, has more depth-of-field.
Learn to ask yourself if you want the background in focus or not.
A good way to ensure that you consider depth-of-field is to use aperture-priority exposure mode.
If you have to set the lens opening, you'll think about depth-of-field.
You can't always use the lens opening that you would like to use.
Sometimes there's too little, or too much, light.
If this occurs, Lo or Hi will blink in your viewfinder, letting you know that you have to adjust the lens opening.
Let's look at another factor that determines depth-of-field.