Fixing a heater to work consistently involves:
Checking the coolant level and refilling if necessary
Ensuring the thermostat and heater control valve function properly
Bleeding the cooling system to remove air bubbles
Flushing or replacing a clogged heater core