Oil is a major source of energy but hardly the only source of energy. The diminishing quantity (increasing scarcity) of oil is reflected in increasing prices for it. Right now, given the infrastructure, fossil fuels are utilized because they are still cost effective. Assuming no major changes in technology (ie, ways to manufacture crude), the finite supply of oil ending, it's not going to be a simple "oops, we're out of oil now! what do we do?"
Prices will continue to rise to reflect the growing scarcity of the resource. At some point, other forms of energy will be comparatively more cost effective, and profit maximizing consumers will move away from oil. It's not a sudden thing, as oil becomes more cost prohibitive, alternative energy becomes more cost effective, and the transition out of oil and into alternative energy begins.