I have seen people turn on the heat inside the car before buying probably checking the head gasket or over heating of the engine? And some people press the coolant hose to check it. Can someone explain how both ways work? Thanks
Why do you think that checks the head gasket?
Turning the heater on checks the heater and reasonable flow through the cooling system. Good in cold places to have a heater...
Pressing the hose finds out if the system is pressurising and can also let you know if the pipes are old and brittle.
The heater not working can be a sign of exhaust gas in the engine cooling system, possibly caused by a leaking cylinder head gasket. Exhaust gas in the heater core will stop heat being transferred, causing a cooler heater.
A leaking head gasket can also cause an increase in pressure of the engine cooling system due to exhaust gasses escaping via the gasket. Pressing on the hose can give an indication of higher than normal pressure inside the cooling system.
Neither of these tests are very conclusive, but can add to evidence of a cylinder head gasket leak.