Let’s define “overheating”. If an iPhone overheats it shuts down so it can’t be used, and displays a message saying it must cool down before it can be turned on, and it will probably be unusable for an hour or so. If you are seeing this it is a hardware problem and you should contact Apple support:
Note that both of the above have options to receive a callback or chat
If you are not seeing this your phone has not overheated. However, if you fast charge your phone may get very warm, and may pause charging at 80% and display a message saying that charging has paused, and will resume when the phone cools down. This is NOT overheating, and is normal when fast charging. It also won’t prevent you from using any app you have on your phone.
Also, some apps that use a lot of energy or that use cellular data rather than Wi-Fi can cause the phone to run warmer. Worst offenders are Facebook, interactive games, watching streaming videos, and the Camera app.