Ground-source heat pumps take advantage of this temperature differences between the soil and air, by pumping water between ground and house.
In summer, heat is transferred from the house to the ground.
In winter, heat is transferred from the ground to the house.