My X was notorious for getting really hot, usually when connected to CarPlay. The phone would get so hot CarPlay would disconnect and the phone would reboot. I would need to hold the phone to the AC vent to cool down, unplug and re-plug for CarPlay. iOS updates didn't address the problem either. The X was a beta-device I feel like...horrible LTE & WiFi connection, poor call quality, overheating during CarPlay, Battery Health went from 100% to 92% in 6 months...at least this is what I experienced with my X, not saying all X's are like this, but it was for me.
Upgraded to the XS Max and never had a single issue as I did with the X.