A water heater is essentially a large water tank with a gas burner or electric heating elements that warm the water. Most hot water tanks are heated by a gas burner because gas is more affordable as a heat source in most parts of the country. A thermostat dial on the outside of the heater or on the gas valve sets the desired water temperature; a thermostat senses the water's temperature in the tank and turns the heat source off and on to maintain the set temperature.
The tank is hooked up to two pipes at the top of the unit: a cold water supply pipe that fills the tank and an outgoing hot water pipe that serves hot water (under pressure in the tank) to the faucets and fixtures throughout the house. The cold water pipe should be equipped with a valve that can shut off the flow to the tank; many plumbing systems also have a valve on the hot water side. As hot water exits the tank, cold water replaces it through a diffuser dip tube that extends down inside the tank.
Although there are two types of water heatersstorage tank and on-demandthe chances are good that you have the conventional storage type of heater. On-demand heaters are efficient and economical because they do not store and continually heat water but heat it as it is required. Because they are less common, it is better to leave their installation and maintenance to people who know what they are doing.
A gas water heater is fueled by natural gas (or, in some cases, kerosene or propane). A gas valve controlled by the thermostat, delivers gas to the burner. A pilot light or electronic spark ignites the gas similar to a gas stove top. The burner heats the bottom of the tank and the water gets hot. Gas water heaters also need a vent at the top to expel exhaust from the burner to the outside.
An electric water heater draws its energy from a heavy electric cable. It doesn't have a burner; instead, one or two separate heating elements cycle on and off, controlled by thermostats, to heat the water. Electric water heaters don't create combustion gasses, so they don't have a vent at the top.
At the base of the water heater, a drain valve allows you to drain the tank or flush out sediment.
Last but not least, there is a magnesium or aluminum rod inside the tank, called the anode rod. Through ionization, this minimizes corrosive elements in the water.
To protect a water heater from exploding under pressure, it has a temperature and pressure relief valve (T&P) at or near the top of the tank; this opens automatically if pressure or heat exceeds a given limit --normally 150 pounds of pressure or 210 degrees F.