The many deaths of Optimus Prime

Across all continuities (except for RID and the live-action-movie-verse, but give it some time), Optimus Prime dies a lot. This happens for various reasons:
 * It allows for him to be replaced by a new character (and thus a new toy).
 * It allows for him to come back from the dead in a new body (again, a new toy).
 * It's dramatic (in theory, or at least, it used to be).
 * It makes him into something of a Christ-figure.

Some examples:

The Transformers: The Movie

 * The best-known example is from The Transformers: The Movie, in which Optimus Prime dies of wounds from his battle with Megatron. Famously, his body turns gray as he dies.  (Urban legend says his body also crumbles, but no such footage is known to exist.)  Being the first time he died, it was actually unexpected.

Season 3

 * He returns from the dead twice; first, as a zombie under Quintesson control in "Dark Awakening" as part of a plan to destroy the Autobots, only to die again when he overcomes the Quintesson control using Matrix and possibly sheer strength will, and then sacrifices himself to save the Autobots. His second resurrection occurs when he is brought to life again to battle the Hate Plague in "The Return of Optimus Prime".

Generation 1 Marvel Comics
In the Marvel continuity, dying and coming back was practically a hobby for Prime.


 * In "Afterdeath!", Prime, after failing to live up to his moral principles while playing a video game, volunteers to be killed. The Autobots launch his funeral bier into space. Fortunately, the creator of the video game, Ethan Zachary, saves a backup copy of Prime's mind on a floppy disk.  We first meet this virtual Prime sixteen issues later in "Pretender to the Throne!".  He gets his new Powermaster body two issues thereafter, in "People Power!".


 * About thirty issues later, Prime sacrifices himself to defeat Unicron, in "On the Edge of Extinction!". However, his Powermaster partner, Hi-Q, survives, and almost immediately begins babbling about how he's really Optimus Prime. This turns out to be true, and The Last Autobot metamorphoses Hi-Q into Prime (with a new Actionmaster body) in the last issue of the original Marvel US series.

Generation 2 Marvel Comics



 * This Prime wasn't done dying yet. His adventures continued in the G2 comics, and he died defeating the Swarm in the final issue of that series, "A Rage in Heaven!". The Swarm reconstituted him three pages later (in a body based on his then-current Combat Hero toy).

The Headmasters

 * In The Headmasters, Optimus Prime Convoy died again — in another act of self sacrifice, of course — when he walked into Vector Sigma and tried to bring it back under control directly in "A Dream Is Born, Double Prime". His body turned gray as he died, followed by a (likely only symbolic) scene of him telling Rodimus Prime that it would be his responsibility to keep leading the Autobots and to continue his work, seen as a transparent, light-haloed figure against the sky and heard in third person narration as Rodimus stared into the sky. (Then again, given the proven existence of ghosts...)

Return of Convoy
Convoy returned as a zombie once again this time as False Convoy resurrected by Dark Nova in a plot against the Autobots, but this plan went awry when the other Battlestars managed to restore Convoy's spark with the power of the Zodiac, evolving him into Star Convoy. ''

Japanese Generation 2

 * In the Japanese version of Generation 2, Optimus Prime was badly wounded by Megatron's fusion cannon and almost died, but was resurrected and evolved yet again, this time into Laser Rod Optimus Prime, by the power of the Matrix.

Beast Era
In Beast Wars and Beast Machines, you could mark the end of a season by the near-death experience of one Optimus or another...


 * At the end of the first season of Beast Wars, Optimus Primal piloted a bomb-equipped stasis pod in an attempt to destroy the Planet Buster. Unfortunately, Megatron had sealed the pod's hatch, and Optimus blew up with it. Early in the second season (a few hours later as far as the characters were concerned), Rhinox managed to unite Optimus's drifting spark with a blank protoform, thus bringing him back to life (and in a new Transmetal body, too).


 * At the end of second season, the Beast Wars Megatron came very close to killing the original Optimus Prime. But Prime didn't quite die, so we really shouldn't count it. However, Optimus Prime was blasted into pieces by Megatron in Beast Wars Metals manga.


 * At the end of the first season of Beast Machines, Optimus and Megatron had a cataclysmic battle, using the energies of Vector Sigma and the Plasma Energy Chamber. This would have destroyed Cybertron, but Optimus took the warring energies into himself and disintegrated. However, his spark was trapped within the Oracle, and the other Maximals convinced him to return to the real world at the start of second season.  The Oracle kindly gave him a new body (which, believe it or not, was not a new toy).

(Strangely, the end of the third season of Beast Wars had no Optimus deaths whatsoever! A half-dozen other characters died, but not Optimus.  Bizzare.)
 * At the end of the series, Optimus gave his life to defeat Megatron once and for all, pushing him into the technorganic core of the planet. In assorted ancillary media (convention comics, text stories), he comes back to life yet again.

Armada cartoon



 * In the Armada episode "Crisis", Optimus Prime used his body to block the blast of Megatron's Hydra Cannon, protecting the Earth. When the cannon's energy is spent, we see Optimus turn grayish-white, then actually crumble to bits. A bunch of Mini-Cons use the Matrix to resurrect him three episodes later.

Armada comic



 * The corpse of an Optimus Prime (killed by Unicron) from an alternate universe appeared in the Armada comic issue titled "Worlds Collide, Part 1". Yep, practically all we know about this Optimus is that he died. He doesn't turn gray, but his colors are faded.

Universe



 * The corpse of an Optimus Prime (killed by Megazarak) from an alternate universe was cloned by Unicron to create Nemesis Prime. The clone, before he became Nemesis, appeared in Universe comic issue "Balancing Act, Part 2". Once again, practically all we know about this Optimus is that he died.

Movies
Prime's plan to destroy the AllSpark and end the war was to unite it with the spark in his chest. He was just one step from doing this, but a certain boy decided to spoil his magnificent plan, pushing it into Megatron's chest.

It'll happen. Eventually. Trust us.

Transformers The Game
In Decepticon mode storyline, Optimus Prime is beaten to the ground, and as he crawls for the All Spark, Megatron smashes his head with his flail ... poor Prime, he gets the most violent death.

Titan Magazines
In an alternate timeline, Optimus was left in a frozen, near-death state.

Transformers Animated

 * In the third part of the Animated pilot, "Transform and Roll Out!", Optimus Prime dies after his battle with Starscream. Like the Generation 1 Prime before him, he turns gray upon dying. Seventy-five seconds later, Sari Sumdac uses the mysterious Key to revive him. It's a new record, Primey!

Kiss Players
Sometime between 2005 and 2010, Marissa Faireborn revives Optimus using the Galvatron cells in her body. Ultimately, all the cells are put back into Galvatron, and without them, Optimus promptly dies again.