We will never "run out" of petroleum, natural gas, or coal. Eventually, as supplies get harder and harder to obtain(wells go deeper, pockets are harder to find, pollution gets to bad, etc) the use of natural carbon supplies will dwindle. Just like the use of buggy whips and candles has dwindled. We've come up with better tools.
Right now, and well into the future, the only viable basic sources of energy are nuclear and solar. Short term there may be some use for biomass derived fuels, but all biomass has to grow on somebody's land and the supply of land is very finite. We need all the best land for food and most people won't want to turn all the rest into power plant fodder. Biomass is just another version of solar power. Solar energy using some type of solar cell is ideal because we have millions of acres of roofs already. The conversion efficiencies are fantastic compared to growing plants for fuel. For most of the people in the world(those living below about the 45th parallel) solar can easily provide all the energy they need, and then some. Nuclear power would be mainly to support industry(we'll still need refineries, chemical manufacturing, and all the other industries), a power grid, and the folks too far from the equator to make solar cells economic.
Keep in mind that there is a big difference between a source of energy(sun, geothermal, coal, oil) and how that energy gets transported and turned into useful work. Electrictiy, gasoline, hydrogen(for cars), biodiesel, etc. are just ways to get the power from where it is to where in needs to be in a convenient, safe, and hopefully not too expensive fashion. As an example, right now diesel electric trains are the rage. There is no technical reason I can see that would prevent someone from designing an equally efficient, modern coal-powered steam(or maybe Stirling cycle) engine using a refined coal oil as a fuel. There are lots of technologies that can compete with traditional petroleum at $100 a barrel that were just pointless to pursue when you could get all the oil you wanted at just a few dollars a barrel.