Remove the Case and Accessories
If your iPhone is constantly getting warm for no apparent reason other than the extreme heat, you should temporarily take it out of its case. Depending on the case you use, leaving it on might cause your iPhone to overheat.
The same goes for other accessories. If you have a MagSafe wallet or any other accessories connected to your iPhone, they could be preventing heat from dissipating properly. So it’s best to remove these accessories at least until your iPhone cools down again.