First of all, don't use your phone all the time. Use your phone only when necessary. Whenever you talk on the phone, don't keep the speaker in front of your face because doing so can prove dangerous for you.
Overcharging is another thing you should not do. Also, never let the phone's battery go below 30 percent. Both these things can prove dangerous for you. Using a phone with low battery makes it heat up.
The phone should not always be used in direct sunlight. If you use the phone in direct sunlight, the brightness of the phone decreases. Sometimes it also restricts the use of the camera and flashlight. Using too much brightness, camera and flashlight generates a lot of heat.
Also, always remove the cover whenever you charge your phone so that heat is not trapped in the phone. Use wired charging instead of wireless charging in smartphones. Never charge your phone with another charger.
If the phone is old, then its battery may also be damaged due to which the phone may heat up or charge slowly. In such a situation, if the phone gets hot, give it time to cool down. Also, you should always keep the screen brightness low.