A hot water tank thermocouple senses heat from the pilot light. If it goes bad or the pilot goes out, the control valve will shut down. The sensor can be affected by too little or too much heat, or bad connections.
How it works is a thermocouple is a bi-metal device that generates a small amount of electricity when heated. The electricity powers an electromagnet that holds a gas valve open that controls the pilot and the main burner.
Replacement is relatively simple although dexterity helps when reaching into the burner area to remove the thermocouple-retaining nut. Sometimes the thermocouple will pull out of the pilot assembly without having to remove the retaining nut. A 3/8-inch open-end wrench removes the easy end of the thermocouple from the control valve. Match the length at a hardware store or home center. To avoid stripping the threads, hand tighten the nuts a few threads before using a wrench. Snug the threads but do not over tighten.
Some situations that can affect proper operation of a thermocouple:
Too little heat. The pilot flame may be set too low. The burner/deflector could be dirty or clogged preventing the flame from engulfing the thermocouple. The pilot flame should surround 3/4-inch of the tip of the thermocouple.
Too much heat. If the pilot flame is torching the thermocouple, it could shorten the life of the thermocouple.
Connection between the thermocouple and the gas valve. Clean the threads and the end of the thermocouple where it attaches to the control valve.
Check the owners’ manual for proper height and adjustment to the pilot flame.