The thermocouple is a safety device that sits in the pilot flame. When heated, it generates a tiny voltage (20-30 millivolts) that holds the gas valve open. When the pilot goes out, the thermocouple cools, voltage drops to zero, and the gas valve shuts off -- preventing unburned gas from filling the room. A failed thermocouple produces insufficient voltage even when heated, so the gas valve closes and the pilot goes out every time you release the control knob. Testing it with a multimeter takes 10 minutes and tells you definitively whether to replace it or look elsewhere.