A head gasket is a seal that sits between the engine block and the cylinder head in an internal combustion engine, preventing leaks of combustion gases, coolant, and oil. It maintains pressure in the cylinders for proper combustion and keeps coolant and oil from mixing. A water pump gasket, on the other hand, is a seal specifically designed to prevent coolant leaks around the water pump, which circulates coolant through the engine.