With a FGR 40 you will need to replace the pilot assy. It incorporates a thermocouple/thermo-switch into the design. make sure the black intake screen at the lower bottom is clean after you replace the pilot assy. This part usually carries a 6 year warranty so check first with the serial number.
Niske if you have the same model then remove and clean the black intake screen at the lower bottom of the heater. You can also use a feather duster to clean the underneath side of the flame arrestor. Stick the duster in the hole behind the black filter and work it back and forth in a 10 inch circle right in the middle of the heater.