Of the survivor of, say, a plane crash where nobody came; they marched across the mountains and rescued themselves. The term I'm looking for is specifically associated with being in a bad place, traveling and being back in a normal/good place. Sort of like "extraction", but the other way around, in that the person was not pulled, they pushed them self.
I like extricate as a replacement for extract, although it doesn't necessarily imply travel, and is not always used for oneself.
: to free or remove (someone or something) from something (such as a trap or a difficult situation)
As in, He extricated himself from the perils of the desert through quick thinking and sheer willpower.
The term soldier on is often used, even in non-military settings
to persist in one's efforts in spite of difficulties, pressure, etc
This does not always suggest arrival at a happy ending, but it may be used in that context. Consider this example
To continue to do something, especially when it is difficult or tedious; persevere: "As Russia decayed, these Siberians soldiered on, finding ways to live and enjoy life" (Jeffrey Tayler).
Also possibly break through
to achieve success, make a discovery, etc, esp after lengthy efforts
Also consider overcome
To deal with successfully; prevail over; surmount: tried to overcome the obstacles of poverty.
American Heritage Dictionary
This type of usage is illustrated in the protest song popularized by Pete Seger, We Shall Overcome.