How to get my photos all in focus?

If i take a picture of something on my dslr one part will be focused depending on the distance but i want it all to be in focus like how the cameras work on iphones, if you don't focus it it ll all be in focus. How do i do that on my dslr.

Use aperture priority or manual mode and make your aperture as small as possible… (F_[high number]_)

You do it by taking your camera out of auto or scene mode and take control for yourself. A DSLR has the level of control to allow selective focus or deep focus - the choice is yours.
To get deep focus -
Set your camera to Av mode
Close your lens aperture to f/16 or f/22
Check the exposure and if your are handholding, up the ISO until the shutter speed is faster than 1/15th if you have IS/VR or 1/50th if you don't
Set manual focus and focus 2/3 distance into the scene or select the AF point to do the same
Shoot.

Learn how to control depth-of-field - one of the vital skills of the photographer.

Set to a high f/number like f/22. To successfully get the shot, you will need to do it under lots of light.

  • Why won't my iPhone 4 camera focus? Every time I go to take a photo of my nails on my phone the camera is really blurry and won't focus. The camera is not dirty and it used to work perfectly fine before. The front camera works fine how it did before its just the back camera that's playing up. How can I get my back camera to work again?
  • My iPhone 4 won't focus when taking distant photos? My iPhone just started doing this. And i've had it for a while. It's never done this before, and it won't focus only when I'm far away from something but when I get right up to the object it focuses perfectly… Is there anything I can do in settings or anything at all without having to go to apple?
  • (Iphone, photos) I have alot of Live photos from a wedding how do i make them all still images? My friend asked me to take some photos at his wedding… Well I did and took around 900 photos, but sadly they were all Live photos. Every time I try to move them to a CD or SD card they show up as videos. Is there a way I can make them all still images without to go to each individual photo and fixing it? (Iphone 8plus)
  • If I delete All my photos from my IPhone cam roll, does that delete All videos as well? I have an iPhone 5 and have just downloaded all my pics from my camera roll onto my computer. Since they're now saved onto something else, I want to delete all of them from my cam roll-- but does this delete all the videos also? (somehow I'm unable to download the videos to my computer).