During the Clone Wars, Yoda was both the Grand Jedi Master of the Jedi Order as well as a Grand General within the Grand Army of the Republic. He participated in very few battles during the war but was powerful enough to survive every battle with the Confederacy of Independent Systems he fought in and also managed to escape the execution of Order 66 at the war's end.
After surviving Order 66, Yoda went into exile on the swamp planet of Dagobah in the Outer Rim of the galaxy. There, Yoda would remain in hiding for years until he was discovered by a rogue Clone Trooper named Danson. Yoda, at the request of the force ghost of Obi-Wan Kenobi, would help Danson get off Dagobah by using the force to repair a downed Republic LAAT/i gunship that had crashed on the planet years earlier.