While the weather in Iceland is often cold, wet, and windy, a nearly endless supply of heat bubbles away below the surface. In fact, almost every building in the  country is heated by geothermal energy, in a process with virtually no carbon emissions. So how exactly does this renewable energy work? Between the Earth’s core and its crust  is a mixed layer of solid and partially molten rock  called the mantle. Temperatures here range from 1,000 to 3,500 degrees Celsius. Some of this heat comes from the radioactive decay of metals. But much of it comes from Earth’s core, which has been radiating energy  since the planet formed over four billion years ago. While the mantle moves slowly, circulating roughly 40 kilometers  below the Earth’s crust, there are places where it surges closer to the surface. Here, the magma forms pockets and veins in the ground, heating underground rivers and pools  to temperatures reaching 300 degrees. Controlling heated water is at the heart of harnessing geothermal energy, and there are two primary models  for how to do it. One is to build a geothermal power plant which uses these hot, deep pools  to produce electricity. First, engineers drill a well several kilometers into permeable rock like sandstone or basalt. As the hot, highly pressurized groundwater flows into the well, the rapid change in pressure  and temperature produces huge amounts of steam. This steam then turns the blades  of a turbine to generate electricity. Finally, the remaining cooled water and condensed steam are injected back into the ground  to create an open loop that provides electricity without losing water. However, we don't have to drill this deep to take advantage of the planet's heat. Thanks to solar radiation, dirt just 1.5 meters deep can reach temperatures over 20 degrees Celsius. Geothermal heat pumps pipe water or antifreeze liquid through this layer of earth  to siphon its energy. These liquids are then pumped  through local infrastructure, dispersing their heat before moving back through the ground to absorb more energy. While external electricity is needed  to operate the pumps, the energy provided is far greater  than the energy used, meaning this process is also a sustainable loop. In fact, geothermal heat pumps are both cheaper to operate and at least two times more energy efficient than fossil fuel equivalents. Whether geothermal energy is radiating just below our feet, or heating water several kilometers deep, the planet is constantly radiating heat. Averaged across one year, Earth gives off roughly three times more energy than humanity consumes. So why does geothermal only account  for 0.2% of humanity’s energy production? The answer has to do with heat, location, and cost. Since geothermal heat pumps rely  on the consistent heat found in shallow earth, they can be implemented almost anywhere. But geothermal power plants require tapping into high-temperature geothermal fields; regions hotter than 180 degrees and  typically several kilometres underground. These high temperature zones are hard to find, and drilling this deep for just one  of the several wells a plant will need can cost up to $20 million. There are regions with shallower geothermal fields. Iceland and Japan are near active  volcanoes and tectonic plate boundaries, where magma rises up through the crust. But these same factors also make  those regions prone to earthquakes, which can also be triggered by intensive drilling. Furthermore, while geothermal energy is clean and renewable, it’s not entirely harmless. Drilling can release vapors containing pollutants like methane and hydrogen sulfide. And drilling tools that use pressurized  water can contaminate groundwater. Fortunately, new technologies are emerging to meet these challenges. Emission control systems can capture pollutants, and electromagnetic monitoring can help detect seismic risks. We're also uncovering entirely new sources of geothermal energy, like pockets of magma  in mid-ocean volcanoes. So if we can safely and responsibly tap into the heat sustaining our planet, we might be able to sustain humanity as well.