Hello,
please check this If your iPhone, iPad, or iPod touch gets too hot or too cold - Apple Support - and see if you can find any information that helps you to make your phone less warm.
Make sure that your phone and all your apps are updated to the latest version. To check your iOS version and see if there are any available updates, go to Settings -> General -> Software Update. To check your apps, go to App Store -> your profile picture -> pull down to refresh. Install all available updates.
Usually, when a phone gets warm there's an app that's misbehaving in the background. One thing that you can check is what apps that use most battery. If one app in particular stands out, try to remove it and see if it helps.