With repeated operation, the heat safety switch / integrated thermostat can get a buildup of carbon (soot) on its contacts after a lot of usage. You’ll know this could be the problem when the light bulb part of the fireplace works fine, but not the fan blower or the heater: the heat safety switch only controls the heater and fan.
If you have an electrical tester, you can also verify this is a problem by testing the resistance (ohms or Ω) between the two sides of the safety switch: it should be near zero, whereas mine was about 2000 ohms (2kΩ). I also noticed that the voltage tested coming into the heater and fan was extremely low, under 80 volts at rest and under 10 volts when trying to power the fan.
All electrical work should be done by qualified individuals and is done at your own risk: heaters use lots of electricity and can electrocute you or start fires when operated or repaired improperly. Do not bypass or modify the safety switch: it turns off the heater and fan when it gets too hot, and without a properly operating switch the heater could easily burn itself (and your house) up! The switch works because the unrestrained side is “bimetallic” and bends away when it gets hot, disconnecting the circuit.
First, unplug the fireplace from electricity. Place the fireplace upside down or face down on a rug to avoid scratching.
Then, unscrew the bottom fan and heating assembly and unscrew the fan from the housing so you can easily access the pictured heat safety switch. Be careful and gentle when removing any components or wires, and be sure that no exposed wires or metal contacts are likely to touch each other or the casing. If you unplug any wires or encounter any unique screws, take photos before removing so you can reassemble correctly.
Using a thin strip of sandpaper, a thin file, or a rough piece of construction paper or newspaper, clean both the top and bottom contact.
Reassemble in reverse order and operate under observation to intervene in case of problems. Keep the area around the fireplace clean, free of dust, and with adequate airflow to reduce soot buildup.