Discussion of this issue may or may not be out of place here, but we had some discussion of rare earths here not long ago. We've also had some discussion of "peak phosphate".
I wish to note that most of the chemical elements that we use are mined. We look for deposits where they are relatively concentrated and then mine them. This raises the question of what we do when the ores run out. It's much like fossil fuels.
But there are sources that I haven't seen much discussion of, except in very limited contexts. Garbage, ordinary rock, and seawater. For garbage, I've seen some discussion of e-waste, but not much more. For ordinary rock and seawater, hardly any. Ordinary rocks are metal silicates, and I've found only a few things on getting the metals out. Seawater should be straightforward to refine. Boil off the water and let its salt content precipitate. The more abundant constituents will precipitate first, leaving the less abundant ones in the remaining water. But I haven't found much on that either.
Some references on mining ordinary rock, mainly in reference to living on Mars:
Aluminum Extraction From Clays - Open Source Ecology
Metal Refining - Open Source Ecology
Bringing Mars into the Iron Age - NASA Science
Homesteading the planets - NASA Science
Related ones:
From Garbage to Glass: Mining Landfills for New Materials | Architect Magazine | Technology, Architects, Recycled Materials, Green Materials, Salvaged Materials, Peter Jones, Ivan Cornejo, Colorado School of Mines, Colorado
The Oil Drum: Europe | Mining the Oceans: Can We Extract Minerals from Seawater?
Abundances of the elements (data page) - Wikipedia
These processes likely require a lot of energy, especially if one wants to recover the rarer elements.
But I think that if renewable sources can be made good enough, then they can supply the necessary energy. Thus, renewable energy may be able to solve not only our energy problems, but also our resource problems.