Thermostats operate by sensing the temperature inside the tank; and if below the temperature setting, they send power through the element, heating the water. A thermostat can often be the main control unit for a heating or cooling . The output of the sensor then controls the heating or cooling apparatus.