A thermostat is a sensor that keeps a heating system near to a desired temperature or setpoint. It is a control system.
The thermostat works by switching heating or cooling devices on or off. This is what happens in a central heating system or an air conditioner. In some systems, it works by switching a 'heat transfer fluid' off or on as needed to keep the set temperature. The name is derived from the Greek words thermos "hot" and statos "a standing".