Turn off the appliance’s gas supply valve.
Locate the flame sensor, adjacent to the pilot light. Remove the cover of the appliance with a screwdriver, if necessary, to access the sensor. Remove the mounting bracket at the base of the sensor with a wrench or screwdriver, depending on the design.
Clean the sensor rod by gently rubbing the rod with a piece of fine-grade steel wool until all buildup is removed from the rod surface and the bare metal is visible.
Reinstall the sensor. Turn on the gas supply and light the pilot. If the pilot will not stay lit, the sensor is faulty and requires replacement.