Yoda is among the Council members who test Anakin Skywalker's force sensitivity, and he muses heavily upon Anakin's fear of losing his mother, noting that fear is the path to the dark side. Following the death of Qui-Gon Jinn, Yoda meets up with Obi-Wan Kenobi, agreeing with his promotion to Master level, but disagreeing with Qui-Gon's wish that Anakin be trained by Obi-Wan, regardless of their earlier decision to refuse to train the boy. Ten years on, Yoda takes a personal interest in the attempts on Senator Padme Amidala's life, sensing dark forces at work. Upon Obi-Wan's discovery of the Clone army on Kamino, and the Jedi Master's later capture on Geonosis, Yoda goes to investigate the Clones himself, and later leads the army into battle to assist the overwhelmed Jedi on Geonosis. A short time later, he finds himself in a pitched battle with Count Dooku, though is forced to let Dooku retreat in order to prevent the deaths of Anakin and Obi-Wan.
Through the years of the Clone Wars, Yoda assists in delegating tasks for Jedi and their squadrons, and occasionally goes into battle himself. In the last days of the Clone Wars, Yoda travels to Kashyyk to aid the Wookies in battle against the Separatists. While he is away, Order 66 is executed, and Jedi are slaughtered all across the galaxy. Yoda senses this through the Force, and feels immense pain and sorrow, but is saved from being killed himself by Tarfful and Chewbacca, who escort him away from the battle so he can retreat to safety. After being picked up by Bail Organa, he joins Obi-Wan at the Jedi Temple, where they learn of Anakin's dark deeds. Yoda decides to confront Emperor Palpatine, the newly revealed Darth Sidious, but is beaten back by the Sith Lord. Following a rescue by Senator Organa, Yoda retreats to Bail's ship, the Tantive IV, and decides he must go into exile following his failure. After giving Obi-Wan special training to undertake during his time on Tatooine, Yoda moves to Dagobah, where he spends the remainder of his life.
Some 20 years after his self-imposed exile to Dagobah, Yoda meets Luke Skywalker, Anakin's son, who has come to Dagobah for training from the old master following instructions from Obi-Wan's spirit. Yoda appears to become unhinged in his lonely exile and tries Luke's patience in a number of ways. When Luke becomes enraged at Yoda's apparent quirks, the old Jedi begins conversing with Obi-Wan's spirit, revealing that he has been watching over Luke his entire life and feels he has no patience. Regardless, Yoda begins to train Luke further in the ways of the Force, though the training is cut short when Luke has a vision of his friends being tortured on Bespin and feels he has to go help them, though Luke promises he will return.
When Luke returns, Yoda has become sick and even more frail. He tells Luke that he requires no more training, but he will not be a true Jedi until he has defeated his father, Darth Vader. As Yoda's life ebbs away, he dispenses one final piece of information: There is another Skywalker. And with that, Yoda quietly disappears into nothingness, and is later seen in spirit form with the spirits of Obi-Wan and the redeemed Anakin, following the defeat of the Empire.