Turn off the gas valve that feed the hot water heater and then wait for the pilot light to burn out if it is still on. Although gas cannot pass through with a defective thermocouple, it is always a good idea to turn off the gas for added safety.
Remove the screws that secure the cover onto the bottom access panel on the water heater. This gives you access to the thermocouple.
Remove the retaining nut that holds the thermocouple in place with a wrench and then pull the thermocouple away from the water heater.
Locate the copper tube that connects the flame sensor to the pilot. Pull the sensor, still attached to the copper tubing off the thermocouple with pliers.
Slide the sensor onto the new thermocouple and then attach the thermocouple in place with the retaining nut and wrench.
Reattach the access panel with the original screws and your screwdriver.
Turn on the gas valve and relight the pilot.