So you're ready for a nice hot shower and...there's no hot water. You take off the cover of the water heater and notice the pilot light is out. What's worse is that it won't stay lit. You may need to replace the water heater thermocouple.
It is a $10 part that is a safety device at the base of your water heater.
The thermocouple acts as a switch. On one end is a part that looks like a thermometer (this part sits in the flame of the pilot). On the other end is a fitting that screws into the gas valve. Connecting the two ends is a wire.
The part works like this: As the one end is heated by the flame, a small electrical charge is generated which tells the gas valve to remain open. When the pilot light goes out, the charge stops and the gas valve closes. This prevents gas from continuing to fill up the base of your water heater.
So this little $10 part does a pretty important job. If the thermocouple is bad, no gas will flow and the pilot will not light.
To change the thermocouple, you will need to disconnect several parts to access it. Before you do anything though, turn off the gas to the unit. Turn the knob on top of the gas valve to the "off" position and turn off the gas supply valve where the gas flex line connects to it. Also, remove the small metal door that stops breezes from entering the burner chamber (In newer units you may need to replace the entire assembly, but they function the same way).
You may get lucky and not have to remove the burner, but chances are you will have to remove it.
There are three lines coming out of the bottom of the water heater's gas valve. The burner's gas line, which is about as thick around as your pinky finger; the pilot light's gas line, which is about one-eighth inch in diameter; and the thermocouple, which looks like a copper wire. It is the skinniest line there.
Gently unscrew the three lines from the gas valve and maneuver the burner assembly and thermocouple out of the chamber. The burner may have a tab at the bottom that slips into a slot at the bottom of the water heater. If so, just lift and push it out of the slot.
Some thermocouples just push into the bracket that holds the pilot in place. Others are secured by a threaded fitting. Unscrew the thermocouple fitting at the bracket (or if you're lucky just pull it out). Your new thermocouple will come with several universal fittings for different sizes and methods of connecting it to the bracket.
With the thermocouple in place, maneuver the burner assembly back into place and connect the gas lines and new thermocouple to the gas valve. Turn the gas back on and follow the directions on the tank to relight the pilot.