Avoid Using Your iPhone in Direct Sunlight
Sunlight can be harmful to both humans and phones. If your iPhone is under the sun for too long, it can overheat.
The best solution is to try using your iPhone inside or in a place with shade. That way, your iPhone will not suffer as much from the heat.