Plan your day in advance and set aside time to find a good location. If the trail runs longer than expected, you will still need daylight to find a campsite away from danger and time to build your tent and campfire. Don't make a camp in an open field, ridge or near tall trees if lightning threatens. You might be a target. Don't build a tent near a ledge or cliff.
Hikers can stumble outside in the dark and fall to their death or serious injury.
If you see that your campsite looks as if water has run through it, move. Find a spot at a higher elevation. Be wary in canyon country where dry washes can be drenched with flash floods within minutes of a rainstorm. When there is snow on the ground, camp away from the bottom of slopes because of avalanche threats. While on the beach, camp well above the high tide mark.