1. Remove the case while charging or gaming.
2. Stop using the phone while it charges, especially for games or video calls.
3. Use the original or a good quality charger. Cheap fast chargers often overheat phones.
4. Check Settings, then Battery for an app using a lot of power in the background, and restrict it.
5. Keep it out of direct sun and hot cars.
6. Update the phone. Updates often fix overheating bugs.
7. If it gets hot even when idle, it can be a failing battery or a short on the board. Switch it off and bring it in.