The principle is very easy, but expensive to install. Just put some pipes in the earth and run water or antifreeze from the building to deep in the ground where it typically stays at 10-13°C. These pipes going deep into the ground work like a heat-exchange system. So the relative warmth of the ground means most of the heating in winter and all cooling in Summer can be done by the earth.
This system seems great because it doesn't burn any fossil fuels, but all the digging in the installation creates some pollution. But the most problematic consequence is that it changes the temperature of the earth deep down. One project doesn't have a measurable impact, but if all buildings in downtown Montréal were heated and cooled that way, the temperature of the ground deep under the city would increase by a few degrees. Now imagine if we were doing that in the permafrost?
One might ask where the electricity comes from to power heat pumps?
It is a small detail ... and many overly motivates in a rush ... say: "ignore the detailings!"
After that the head man is off ... somewhere ... detached sensations?