If your vehicle is showing heater output fluctuates between hot and cold while driving, here are the most likely causes and the parts you'll need to fix each one.
If the coolant level is low or there is trapped air in the system, the heater core will intermittently starve of hot coolant. This often happens after recent cooling system repairs if the system wasn't bled properly, or due to a slow leak.
The thermostat regulates engine temperature. If it sticks open or operates erratically, the engine's overall coolant temperature will fluctuate, which directly causes the heater output to swing between hot and cold.
A worn water pump impeller may fail to circulate coolant effectively at lower engine RPMs. This causes the heater to blow cold when idling or driving slowly, but hot when accelerating.
Sediment or rust can restrict flow through the heater core. At higher RPMs, the water pump forces enough coolant through to provide heat, but the flow drops off at lower speeds, causing the air to turn cold.
The actuator that controls the hot/cold air mix doors, or the valve that allows coolant into the cabin, can fail or lose its signal. This causes the temperature blend to drift randomly while driving.
A failing head gasket can pump exhaust gases into the cooling system. This creates massive air pockets that block hot coolant from reaching the heater core, often accompanied by engine overheating.