Why is my phone overheating?
My pixel XL is overheating. What should I do to prevent this from happening?
Try taking off your phone case. Some cases insulate the phone in a way that makes the phone overheat.
If this doesn't work, try closing apps that are not in use. Also, do not use very intensive apps for large amounts of time.
Finally, if all else fails you might want to replace your battery. There is a guide to learn how to replace your battery on the device page here on iFixit.
you should close all your programs when you want to use your mobail phone for the long period