That depends on where you are, what you have, and what you need to do.
It is quite a large topic, but I would propose the first part of the decision is "can you do anything for this person at all?"
You are then going to have to determine if you can be rescued, have to travel some...