I was hiking once where I got lost. Once I got my bearings straight I looked on a map and saw the trail I was trying to reach was down the side of a somewhat steep embankment. Instead of going around it, I went down the embankment. It was not a good idea as I've heard of people who were seriously injured or even killed doing something similar.
But that was a while ago. These days (not that I'm in anywhere near the same shape) I probably would preload my path in a mapping app on my phone and carry USB power banks. Even without cellular/internet services, it should still have inertial navigation and GPS which would show my location on a map. Back then I was using a paper map and compass.