Solar power, that's obvious, but the energy in coal originally came from the Sun too.
Prehistoric plants stored the Sun's energy in their leaves, and when they died and eventually formed coal seams, that energy was still there.
So when we burn coal (or any fossil fuel), we're releasing chemical energy that was stored in plants millions of years ago.