Hello Annully44
Your phone can get hot for many reasons, including overuse, apps running in the background, malfunctioning software, malware, or if it's simply been exposed to too much heat or sun. While some warmth is normal, if your phone is regularly overheating, there could be a more serious problem going on.
Background App Refresh can also contribute to your iPhone overheating, So go to Settings and then choose General to make sure it's turned off. If it's still too hot, -double-click on the Home button or Swipe Up On Non-Home button- to see all the apps you've got open. Close them all down to help your handset cool down.
I personally recommend hard resetting your iPhone, you'll force it to abruptly turn off and back on. Sometimes crashed software can cause screen glitches, so restarting your iPhone may fix the problem
Your phone's internal temperature is based on the temperature of its environment. If your phone gets too hot, it can experience problems like battery drain, forced shutdown.
If this further does continue after a variety of several tests & solutions, I recommend Contacting Apple Support
Have a good day!