When you drive up to a campsite, I encourage you to try this.
Have a drink, eat a snack, and walk around the campground. Spend at least 20 minutes experiencing the environment before you choose a spot for your sleeping area.
Here is a photo of my truck-camper in a dispersed camping area on the Kern River. I rejected three entire campgrounds before deciding upon this one, because it had trees. I chose a spot with the largest tree, as it was winter and tree cover insulates you from cold, protects you from rain, and provides valuable shade.
Some things I look for
Essentials
Where will I be toileting
Is there fresh running water
Are there insects or varmints
Sleeping
If I'm sleeping in the truck, can I get it level
If I'm sleeping on the ground, is there an appropriate flat spot
Is there good drainage or threats of puddles
Trees, boulders, or vegetation for cover
Hanging out and cooking
Is there a fire ring
Is there a picnic table or a clear area to set up a table
Trees or poles for flying tarps
Am I too close to other campers, the road, the toilets, or the garbage
Most of these things can be determined as you walk around and then sit for a spell to contemplate.
There's no rush to set up a spot unless the weather is horrible. It's not impossible to set up in the rain or the wind but it is easier if you find a place with cover.
Most of these concepts still apply to backpacking. As you approach a spot you expect to sleep, you will have had plenty of to think about toileting, water, vegetation and rock cover, your cooking needs and so on. If you intend to find or set up your sleeping area in the dark, don't rush, really use that lamp and look around for hazards.
My buddy goes backpacking in the Sierras and his hot pro tip was to set up your "throne" at night, so when you have to poop in the morning you can just hoof over to your pre-selected safe spot with a pre-dug hole. Now that's smart.