From The Lord of the Rings wiki
Gandalf the Grey
Gandalf the Grey is a powerful wizard and a member of the Istari who serves as a primary guide and mentor to the Fellowship of the Ring in their quest to destroy the One Ring.
Gandalf the Grey, also known as Mithrandir, is one of the five Istari sent to Middle-earth to oppose the rise of Sauron. As a Maia, he possesses immense wisdom and magical capabilities, though he is constrained by his physical form. He is instrumental in the formation of the Fellowship of the Ring, providing crucial guidance to Frodo Baggins, Samwise Gamgee, Meriadoc Brandybuck, and Peregrin Took during their journey from the Shire.
Role in the War of the Ring
Throughout the conflict, Gandalf acts as a strategic advisor to the free peoples of Middle-earth. He works closely with Aragorn, Gimli, and Legolas Greenleaf to rally resistance against the forces of darkness. His influence is pivotal in the battles against Saruman and the eventual defeat of Sauron, marking him as one of the most vital figures in the history of the Third Age.