Sometimes heats, sometimes blows cold. Flame sensor or limit switch.
Soot buildup on the sensor causes it to lose its ability to detect the flame, shutting down the furnace.
If the thermostat fails to sense the correct temperature, it won't signal the HVAC to run.