Freedom is the right of all sentient beings.
Before the war, Optimus Prime was originally Orion Pax, a young dock worker with a girlfriend named Ariel. But as the war began, Megatron destroyed them both, and Alpha Trion rebuilt them into more powerful warriors.
Four million years ago, Optimus Prime ended a Decepticon attack on the Ark by directing it towards prehistoric Earth. When both factions reawakened in 1984, Optimus Prime and the Autobots fought the Decepticons on numerous occasions until 2005. During an attack on Autobot City on Earth, Prime fell in battle against Megatron and passed the Matrix of Leadership to Ultra Magnus.
Optimus Prime eventually returned, once as a zombie, and again when he was rebuilt by the Quintessons to stop the spread of the Hate Plague.
The details between these events differ between universes. Sometimes Optimus Prime merged with Vector Sigma soon after defeating the Hate Plague, and returned much, much later as Star Convoy. Sometimes Optimus Prime partnered up with Marissa Faireborn to receive upgrades through mutual kissing. Sometimes… look, he did a lot of weird stuff, okay? He later sacrifices himself to restore the Matrix of Leadership.