If you have a gas water heater with a pilot light that won’t stay lit, it’s probably due to a failed thermocouple. The thermocouple is a thermoelectric device that shuts off the gas if the pilot light goes out. In simple terms, it’s a short piece of tubing that runs from the gas controller to the pilot. The pilot end of the thermocouple and the pilot are held side by side in a bracket that’s anchored to the burner.
It is also possible you have a blockage in the tiny tube that supplies gas to the pilot. If the tube is blocked, you can clear it by inserting a thin piece of wire or blowing air through it.
If your pilot light won’t stay lit, the thermocouple probably needs to be replaced. A new one costs about $5 to $10 and is easy to install:
Turn off the gas supply.
Make sure that the gas controller is in the off position before attempting this repair.
Unfasten the three nuts that hold the thermocouple and the two gas tubes to the valve.
The burner typically sits loosely — or under clips — in the burning chamber and just slides out.
Detach the thermocouple from the burner.
The thermocouple is usually attached to the pilot gas supply tube with one or more clips that snap into place. The end of the thermocouple is inserted into the pilot assembly and can simply be pulled out.
Take the detached thermocouple with you to the home center or hardware store and buy a new one.
Install the new one the same way that you removed the old one.
Attach the end of the new thermocouple into the pilot assembly and reattach the thermocouple to the pilot gas supply using the clips previously removed, reinstall the burner and, using a small open-end or adjustable wrench, reconnect the thermocouple lead, the gas tube to the main burner, and the pilot gas tube to the valve.
Turn the gas back on and follow the lighting instructions on the water heater.
Check for gas leaks by applying soapy water to joints and looking for bubbles while the main burner is firing.