Gandalf the White:
Gandalf was sent back, until the end of the War of the Ring, though more powerful. Apparently weapons could no longer hurt him: Indeed my friends, none of you have any weapon that could hurt me. (LOTR.516)
After meeting Aragorn, Legolas and Gimli, on the borders of Fangorn Forest, where they were following Merry and Pippin after the two hobbits had escaped from Saruman's orcs. Then Gandalf rode back with the three hunters to Edoras. There he showed Gríma Wormtongue as a traitor, and released Théoden from Wormtongue's poison/spells. After the Battle of the Hornburg, in which he lead the charge of Erkenbrand and his soldiers, Gandalf was sometimes known as the White Rider.
After visiting Isengard, to try to convince Saruman to help, Gandalf
showed himself as the more powerful and removed Saruman from the
number of the Wise, and broke his staff:
"Come back, Saruman!" said Gandalf in a commanding
voice. To the amazement of the others, Saruman turned again, and
as if dragged against his will, he came slowly back to the iron
rail, leaning on it, breathing hard. His face was lined and shrunken.
His hand clutched his heavy black staff like a claw.
"I did not give you leave to go," said Gandalf sternly. "I have
not finished. You have become a fool, Saruman, and yet pitiable.
You might still have turned away from folly and evil, and have been
of service.But you choose th stay and gnaw the ends of your old
plots. Stay then! But I warn you, you will not easily come out again.
Not unless the dark hands of the East stretch out to take you. Saruman!"
he cried and his voice grew in power and authority. "Behold, I am
not Gandalf the Grey, whom you betrayed. I am Gandalf the White,
who has returned from death. You have no colour now, and I cast
you from the order and from the Council."
He raised his hand, and spoke slowly in a clear cold voice. "Saruman,
your staff is broken." There was a crack and the staff split asunder
in Saruman's hand, and the head of it fell down at Gandalf's feet.
(LOTR.606-607)
After the Winged Nazgûl was seen, Gandalf took Pippin and rode
for Minas Tirith. In the first days of the Darkness, he drove off
the Nazgûl, to allow Faramir and his men to return to the City:
At that moment he caught a flash of white and
silver coming from the North, like a small star down on the dusky
fields. It moved with the speed of an arrow and grew as it came,
converging swiftly with the flight of the four men towards the Gate.
It seemed to Pippin that a pale light was spread about it and the
heavy shadows gave way before it; and then as it drew near he thought
he heard, like an echo in the walls, a great voice calling. (LOTR.841)
But now the dark swooping shadows were aware
of the newcomer. One wheeled towards him; but it seemed to Pippin
that he raised his hand and from it a shaft of white light stabbed
upwards. The Nazgûl gave a long wailing cry and swerved away; and
with that the four others wavered and then rising in swift spirals
they passed away eastward vanishing into the lowering cloud above;
and down on the Pelennor it seemed for a while less dark.
(LOTR.841)
It was at Gandalf's council, that Aragorn, and the Captains of the Host of the West marched out to do battle with the forces of Mordor. This gained the Ringbearer the time needed to complete his quest.
Gandalf journeyed back with the hobbits to maybe an hour's ride
outside the Shire, then he left them. Two years later, Gandalf joined
the Ringbearers and the Keepers of the Three Rings on their journey
into the West. It is implied that Shadowfax went with him. It was
at the Havens that it was revealed to us that Gandalf had long held
the Third Ring, Narya which was given to him by Círdan.
The Silmarillion