Depend on the location Thermal Heat from the Earth Core, Solar Radion from the Sun,...
What I dont understand why nobody on the north or south Pole just drill a Hole deep enough where the Core warm up the Ground to 30c and use that to heat the Station there indefinitely. 
It is funny. This is a technicians and engineers site. Where numbers matter.
This is absolutely conceptually possible. But it costs a lot to drill one of those deep holes. Add a another big chunk for the machinery to convert that heat to usable energy. Add some more for maintenance costs on stuff that is kilometers underground and hot as Hades. Then that free energy costs more than solar, wind, nuclear or fossil. Except for a few special cases where geology brings the heat closer to the surface. Iceland does a fair bit of this, and there are geothermal plants in California and other locations in the US west. Probably other places. But they are all barely economically sound.
And the icing on the cake. It doesn't last "indefinitely". There is a lot of heat there, but any location cools off it you use it as a heat source. If you sip energy out of it the duration is long with respect to our species, but if you gulp it by powering large cities and industries the time scales are much shorter.
It's debatable, if we add up all the costs fossil fuels are a losing proposition.
For example, to get a gallon of gas into your car we need to...
1)Drill a deep very expensive oil well
2)Buy and bury countless miles of steel pipe to transport the oil
3)Refine the oil in a big very expensive refinery
4)Transport the refined products countless miles
5)Sell the refined products in countless service stations
This does not include the millions of tons of steel well casing and abandoned pipelines never cleaned up rotting in the ground usually written off ie. subsidized by taxpayers. Nor does it include the trillions and trillions of dollars damage done by the pollution created by leaks and burning fossil fuels.
It's weird, here in Alberta everyone is always whining about how high the taxes are yet we give billions in subsidies to the fossil fuel industry. The latest scam is where all the oil/gas companies sell marginal or depleted oil/gas fields to shell companies then declare bankruptcy leaving taxpayers to foot the bill.
It may very well be the biggest scam in history if we look at the total cost from start to finish, the total damage done and massive taxpayer subsidies. Of course, I did not include all of the past wars (taxpayer funded military/weapons, infrastructure damage and deaths) including all the present wars related directly to oil otherwise the real cost would be beyond all reason and sound completely insane.
You do read the news don't you?. Where the U.S. has killed the leaders of or invaded other countries and the President said it was to "get the oil".