What technology do IR temperature guns use?
The magic word is "contactless". The thermometer itself does not change temperature very much. I have a cheap plastic version of one of these and have seen temperatures from -100C (pointed at clear night sky) to +250C from cooking.

The device will be built around an Infra-red (IR) light sensor like this one. You can see from the datasheet:


  -40°C…+125˚C for sensor temperature and  -70°C…+380˚C for object temperature


The principle of operation is the Stefan-Boltzmann law. In the particular IR band used, the amount of IR light visible is almost perfectly proportional to the temperature of the object. The device then just needs to subtract its own temperature in order to determine how hot the target is.

This is the same phenomenon as "white hot" and "red hot" objects visible to the human eye, but by using the IR band we can determine temperature in a much more useful range for everyday life.

(Bonus content: a great climate science paper by Forrest M Mims III, the author of various tutorial books, on measuring water content of the sky using cheap IR thermometers)