How to prevent iPhone 12 Pro from overheating?
If you have a cover or case for your phone, you should try removing them as they tend to hold in the heat. Keep you phone out of the sun and use it in a cool area. You can also turn your screen brightness down some and kill background apps you are not using. If that doesn't help turn off Location Sevices on your phone. Do this by going to settings-privacy-location services off.
These and other options are described here and here.