There is really only one way to avoid a survival situation. If you follow one rule, you will never become lost. This rule is very important. This rules is - STAY FOUND! If you know where you are, then technically, you are not lost. You might be stuck by not knowing how to get back to help, but you will not be lost. To prevent a simple wandering off the trail scenario turning into a life or death survival situation. Just remember one thing: STOP
Stop - Don't take another step in any direction. Stay calm, and know what you're doing. Chances are, your absence has been noticed and people are already on their way.
Think - Think about the situation. If you think you remember how to get back, grab some rocks and take your shirt off and put it in a very visible place with an arrow pointing in the direction you have gone. This is in case the search party finds where you are camping so they know where to look for you and the rocks are so you do not lose your way back and get separated from all of your supplies.
Observe - Look around, find an open spot where you can be seen easily and use it as a base camp. Do not explore your surroundings. Chances are, your absence has been noticed and a search party is already looking and possibly en route and if they find where your base camp is, and you're not there, they will continue looking.
Plan - Take inventory of your supplies and prepare to spend the night. Only focus on the basics: Shelter and getting found. Do not waste energy on finding food. Most people are found between a few hours and less than a week. A healthy person can survive for three weeks without food so there is nothing to worry about except a little discomfort.