Tank-style water heaters fill the water heater tank from the main as cold water. Then an element at the bottom of the tank heats the water using electricity or gas. A thermostat controls when the elements are turned on. You can control the temperature of the water using settings for the thermostat.