When two bodies at different temperatures are placed in thermal contact heat will flow from the hotter body to the colder body. The flow of heat is a natural, spontaneous process and requires no assistance. Neat can however, be made to flow from cold to hot with the aid of a heat pump.
Heat pumps are used in refrigerators. The inside of the refrigerator is colder that the outside. Despite this heat is driver from the cold inside to the warmer outside.
Inside the refrigerator volatile liquid evaporates at low pressure and cools. The cool vapour absorbs heat from the inside of the refrigerator. As it passes through a compressor on the outside of the refrigerator, it is compressed and is heated. The hot vapour loses heat to the surroundings and cools and condenses. The liquid evaporates again on passing through an expansion valve and the process is repeated.