There are many different kinds of heat pump used to heat or cool liquids or gases through heat exchangers. The input is from a compressor, usually driven by an engine which is often an electric motor for smaller units but could be an engine using any fuel.
Compression and expansion of a gas causes it to heat or cool. Heat pumps use various transfer gases under a range of pressures. Often these are called "refrigerants" because that was the first application for a practical heat pump a century ago. They have labels like "R32" and "R401" and are NOT DIY commodities. This gas is pumped around a closed circuit that connects two or more heat exchangers, one input and the rest output. Do not confuse the transfer gas with a working gas running through the open side of a heat exchanger.
A variety of liquids or gases can be fed to the input and output heat exchangers. Some systems are reversible, swapping the inputs and outputs. In different modes and different world areas, terminology is diverse.
Replacing a gas combination boiler with a heat pump Basic design considerations and the difference between the two kinds of boiler.
See also some example projects