Optimus leads the Autobots against the Decepticons, the evil members of the Transformers universe. He is generally depicted as a compassionate and brave character, who does his best for the good of the universe. He is driven by his strength of justice and purpose, and he dedicated himself to protecting all life, including people living on Earth.
Optimus Prime in his original form can transform into a cab-over truck. The cab itself can transform into a robot of Prime, with a laser rifle and much strength. In his chest is the Autobot Matrix, also known as the Creation Matrix, which is carried by each Autobot leader and passed down as time goes on.
If you go by the comic book franchise, this says that Prime's direct predecessor was Sentinel Prime, but Optimus already has the talisman when Alpha Trion rebuilds him from what he was before. His trailer can disconnect, and it can transform into the Combat Deck, which is a mobile command headquarters and battle station, equipped with an Auto-launcher and artillery weapons. It also serves as a radio antenna for communications on the battlefield, between the various Autobots.
The Combat Deck also is able to launch the third component of Prime, which is Roller, a scout buggy who can sneak behind enemy lines. The senses of Optimus are tied into those of Roller, so he knows what Roller does. If any component is injured, this is felt by the rest. Even though Prime can survive the destruction of either of his components, they cannot survive without him.
In the 2007 film, Optimus Prime came to Earth after Bumblebee sent a beacon to his comrades. Prime landed in an area outside the Tranquility areas, and Mikaela and Sam, (the humans) watched, as Prime transformed himself and left the landing area. He became an Earth truck, and met up with the other Autobots and the humans in an alleyway. Prime then assumed his robot form while the humans watched in astonishment. After he knew who they were, he explained their need to find Allspark.
Optimus Prime told his troops to wait outside the house where Sam lived. The humans thought that Optimus' heavy footfalls were an earthquake. He tried to hide, also unsuccessfully. Sam nearly had a panic attack, so Prime ordered his fellow Autobots to fall back. Ratchet was choked by power lines, which caused even more problems. Prime's old friend Ironhide was in favor of killing Sam's parents, but Optimus reminded him of their oath not to kill, and Sam's parents were kidnapped.
Optimus sent the Autobots after the humans, and he himself intercepted the vehicle they were in. He ripped the roof off and made his displeasure obvious at the attempted apprehension of the the humans. Optimus ordered his friends to take the weapons off the other agents, and told the Autobots to scatter. In the meantime, he took Mikaela and Sam with him and hid under a bridge. The humans were recaptured.
Optimus sadly left Bumblebee and the humans, because he didn't want to use deadly force to retrieve them. Prime located the Allspark, but he was adamant about not harming the humans. Ironhide was seemingly OK with the use of deadly force, but Prime spoke out against it. Optimus Prime sacrificed his life to destroy the Allspark, so that the humans wouldn't have to pay for the Cybertrons' mistakes.