So when we talk about generating electricity, we're really only talking about converting energy from something into electricity. That something can be almost anything: coal, wind, sun, oil, gas, the energy of flowing rivers, gravity, whatever.
It only needs a look at a fierce thunderstorm or a tsunami to see that there is no shortage of energy in the world. And physics tells us that all this energy can be converted to other, more usable forms. Even the conversion problem has been largely solved as Engineers have invented clever solutions to convert almost anything with energy into electricity.
Unfortunately, this is where physics and engineering stops and economics starts. Demand and supply comes into play, costs become a factor, artificial scarcities and monopolies rear their ugly heads, agency problems become apparent, asymmetrical information complicates things.
Physicists and Engineers did their job a long time ago. It's up to the Economists now.