Nuclear energy comes from natural materials of the earth that arrived in their current form (it is basically recycled supernova energy from long long ago)
Geothermal comes ultimately from the gravitational energy of the earth itself compressing and heating it
Literally every other energy source (edit: aside from tidal and some others that people pointed out) is some form of modified and stored sunlight, in some way or another.