NO Heat And Heat

I have heat sometimes and then no heat?? I changed coolant and thermostat,water,pump,and i have it flowing out of cap at resivior?? turn on heat cold air blows then shut off hear water flowing then turn it back on got heat then eventually goes cold??? 1998 Ford F150 4.6 W in vin and suggestions or shall i just rebuild the engine ooh ya and replaced heater core???

There’s probably air trapped in the cooling system. To purge any air out of the cooling system try this.

Get the engine up to operating temperature. With the engine idling slightly loosen the upper radiator hose clamp. Take a small flat bladed screwdriver and slip this beween the upper radiator hose and the radiator hose neck. Allow the engine to idle until all that comes out of the upper radiator hose is coolant. Retighten the hose clamp.

Tester

Ok ill give it a try thanks for all your help!