I've seen many online tutorials etc. explaining depth of field, many of which are very good. But I wanted to post a simple illustration where I shot two shots very differently with the intent of illustrating the power of using depth of field in the shots. Depth of field can be controlled really by using two things, your aperture and your zoom. I used two images shown here taken of my sons at Disneyland during Halloween.
In simple terms the lower or wider the aperture, the more blur or bokeh you are going to create. This is especially desired in portraiture photography where you have one subject, or multiple subjects that are the same distance from the camera lens. You will also create this effect by zooming into the picture. The more the zoom, the more the blur. This is known as creating a shallow depth of field. In the image provided you can see how my son Kevin standing in front is in focus, my second son Jason is less in focus, and my son Michael in the back is very out of focus.
To create a large depth of field you use a higher aperture, usually f8 or higher and also minimize your zoom. This is primarily used for landscape photography, and also for group shots like at weddings etc. If you don't use a larger depth of field when shooting group shots, the edges of the images and anyone standing in the edges will begin to distort or blur. In the image provided you can see all of my sons are in focus which was achieved by changing my f stop (aperture) to f/13 which gave me sharper focus for all areas of the image.