Saved by the Phlebotinum

One of the major characters of the story, usually (but not always) on a quest to find the aforementioned phlebotinum, is at death's doors and finds the phlebotinum just in time to save their life.

Compare Phlebotinum Muncher, who has to do this constantly.

Anime and Manga

 * In the original Yu-Gi-Oh! manga, before it was hijacked by card games, Yugi's Millennium Puzzle is stolen and he is forced to play a cursed game to win it back, with a loss resulting in the loss of his soul. He plays, and loses... but touches the puzzle at the last second, allowing his Super-Powered Evil Side to jump into his body and use it to win his soul back.

Film

 * In the Stargate movie, Daniel is shot by one of the staff weapons and (apparently) dies. He wakes up in Ra's sarcophagus, having being resurrected.
 * In Indiana Jones and the Last Crusade,
 * The Golden Voyage of Sinbad. Prince Koura is trying to obtain the three golden tablets and get them to the Fountain of Destiny. Unfortunately, his use of black magic ages him and by the time he gets there he's an old man close to death. Luckily for him, one of the tablets restores his youth.

Literature

 * Raistlin Majere of the Dragonlance chronicles, overcome by injuries and the fact his body was not too healthy in the first place, appears on the doorstep of a magical library and manages to decipher enough of the tomes to help regain his strength.
 * In the Hyperion series by Dan Simmons: On his journey down the River Tethys, Raul Endymion contracts a near-fatal kidney inflammation and is only saved by finding  that promptly cures his ailment as they set off for their next destination.
 * Subverted with Ponce de Quirm in Discworld, who spent his entire life searching for the fountain of youth. Eventually he found it as an old man, and only then learned the important thing about drinking the water from the fountain - boil it first.

Live Action TV

 * Star Trek: Deep Space Nine. Averted in "Children of Time".

Video Games

 * There was a less-known Mortal Kombat-style fighting game (its name eludes me for now) where the Big Bad was a Mad Scientist who, after building a temporal portal of some sort, is attacked and nearly killed by a band of Hellraiser-esque demons. He manages to escape through the portal and is later turned into a Hollywood Cyborg killing machine.
 * Star Control II starts with a similar scenario, where a Terran force cut off from Earth and supply lines discovers a cave full of Precursor technology.
 * Occurs at the end of Might and Magic VII / beginning of Heroes of Might and Magic IV: Just as the clash between the Sword of Frost and Armageddon's Blade is bringing about an Earthshattering Kaboom, the player's party discovers an entry into the Portal Network connecting various worlds. This is then used to send the survivors to safety on another world.
 * I don't remember anything like that happening at the end of Might and Magic VII. I mean, you found the portal, but the world wasn't being destroyed. Might and Magic VIII came afterwards and took place on the same world.