This demonstrates Gandalf’s selflessness in caring for others before himself, but also in his commitment to the fight against evil. He knows that if the Ring is lost, then everything would have been in vain.
"I Will Not Say 'Do Not Weep' Because Not All Tears Are Evil"
It's Okay To Cry
Endings are always sad, and the end of The Return of the King is no different. With Frodo, Gandalf, and Bilbo departing on the Elven ships from the Grey Havens, the remaining Hobbits naturally shed some tears at losing very close friends. Rather than tell them not to cry, Gandalf tells them to embrace the tears.
After all the tears shed in pain, fatigue, and anger, tears shed over the strength of a friendship are a welcome change. Friendships forged in shared dangers and hardships are hard ones to lose.
"Death Is Just Another Path, One That We All Must Take."
There Is Peace In Accepting The Way Of Mortality
Aragorn is undoubtedly the master of inspirational speeches, but Gandalf is the best at giving out words of wisdom. In one of the darkest moments of the Battle of Minas Tirith in The Return Of The King, he offers some comforting advice to young Pippin.