In many ways, the price system does not really work to do this. For example, there are many places in the United States where water from aquifers is running out. The demand does not seem to be dropping and there end up being shortages of water in some places. However, the price system should, in theory, prevent the overuse of such resources.
The way that this happens is that prices will rise as a resource becomes scarcer. Let us imagine, for example, that a certain kind of fish is becoming rare because of overfishing. In that case, the price of that fish should rise to a significant degree. When the price rises too high, consumers will no longer be willing to buy very much of that kind of fish. The consumption should drop and therefore there should be less fishing and the fish population would be able to recover. The same thing should happen with oil. If oil stocks start to dwindle, the price should go up so high that people try to find other sources of energy.
In theory, then, the price system would work to prevent overuse of a nonrenewable resource.