The answer to 'how does water heater work' is that a water heater uses electricity, natural gas, or propane to heat water stored in a tank. The tank has an insulated outer shell to keep the water hot, and a thermostat controls the temperature. When the water cools below the set temperature, the heater turns on to reheat the water. This provides a consistent supply of hot water for your home's sinks, showers, and appliances.
Water heaters come in different sizes based on the number of people in your household and the amount of hot water you use. Proper maintenance, like flushing the tank annually and checking the anode rod, can extend the lifespan of your water heater.