A typical refrigeration (vapor compression) cycle usually consists of four major components & working fluid is the refrigerant. Four major components are evaporator, compressor, condenser & expansion device. As refrigerant evaporates in evaporator it absorbs heat & hence produces cooling effect. Further it gets compressed in compressor and the hot discharge coming out from compressor passes to condenser where it gets condensed resulting in heat rejection. Condensed liquid refrigerant then gets expanded in expansion device thus completing the cycle.
With this potential of heat absorption from a low temperature source & heat rejection to a high temperature sink, the refrigeration cycle can serve cooling as well as heating applications.