Do you know what depth of field is? It is actually the amount of distance between the nearest and the farthest objects that appear sharp in focus in a photo. The depth of field can be easily controlled using your aperture.
Do you know what aperture is? It is actually the size of the opening in the lens, measure in f-number to control the amount of light entering the lens. The aperture also affects the depth of field.