Non-sustainable heat extraction is much more likely, because the sustainable resource is only about 44 TW, while world marketed energy consumption is already 18 TW (https://en.wikipedia.org/wiki/World_energy_supply_and_consum...). By contrast, there are about 100 000 TW of solar energy available. There are billions of years of fossil heat locked up in the crust, amounting to conservatively many millions of times the total oil supply, and by extracting it faster than it was produced you can get much higher power.
Like (above-ground) nuclear energy, this is not currently an economically competitive source of exergy because of the cost of the heat engines required, except in unusual cases. It was until only a few years ago, but PV has gotten much cheaper since then. It probably won't be again until a revolution in manufacturing technology.
But for humans living on earth today, and in timescales we care about (millions of years), the Earth’s core won’t run out of heat.