Before coming to Middle-earth, Gandalf was known as Olórin in Tolkien’s mythology.
Olórin was a Maia who lived in Valinor and was associated with wisdom, pity, and the Valar. He was sent to Middle-earth as one of the Istari, the five wizards dispatched to oppose Sauron. In Middle-earth he took the name Gandalf among Men and was called Mithrandir by the Elves.
The name changes reflect different languages and stages of his existence, rather than separate characters. Curunír is Saruman’s Elvish name, while Aiwendil is the name associated with Radagast. These similar-sounding wizard names are a frequent source of confusion.
Gandalf’s mission was not to dominate Sauron by force. The Istari were meant to encourage the peoples of Middle-earth to resist evil themselves. Gandalf’s compassion, especially toward Bilbo, Frodo, and Gollum, is therefore central to his role in the wider story.