temperature issue and restart

my iphone x shows “iphone needs to cool down before you can use it” and it takes auto restart after 5 minits 5 minits..whats the problem,,and give a solution

crwdns2934089:0crwdne2934089:0 crwdns2934093:0crwdne2934093:0

crwdns2934109:0crwdne2934109:0

crwdns2889612:0crwdne2889612:0 0
crwdns2934285:0crwdne2934285:0