FRODO: What food have we got left?
SAM: Let me see. Oh, yes, lovely—lembas bread. And look, more lembas bread. [Taking a bite of the bread.] I don't usually hold with foreign food but this Elvish stuff, it's not bad.
FRODO: Nothing ever dampens your spirits, does it, Sam?
How do you keep going in a barren, rocky place like Emyn Muil when you're lost and have had nothing to eat but dry bread for days or weeks? It's all about attitude. It's hard to dampen Sam's spirits. He can always find some good in their situation, even when their journey is at its bleakest.
ÉOMER: Look for your friends, but do not trust to hope. It has forsaken these lands.
Don't blame Éomer; he has a reason to abandon all optimism. After being thrown from Edoras by Wormtongue, he's roaming the land, taking out his anger on the orcs. But if there's one thing that The Two Towers has to teach us, it's that hope is a hero's most valuable resource.
ELROND: He is not coming back. Why do you linger here when there is no hope?
ARWEN: There is still hope.
Arwen and Elrond are talking about two different kinds of hope. Arwen believes that men and elves may still prevail against the dark lord; Elrond doubts this but when he sends troops to Helm's Deep we see he still has some faith left. But the hope Elrond speaks of is the hope for her future with Aragorn. Even if he survives the war, she will live forever and he will die a mortal man. This is just the fact of their beings. Sometimes hope and reality don't match up.
LEGOLAS: Look at them. They're frightened. I can see it in their eyes. Boe a hyn: neled herain dan caer menig! [And they should be; three hundred against ten thousand!]
ARAGORN: Si beriathar hyn ammaeg na ned Edoras. [They have more hope of defending themselves here than at Edoras.]
LEGOLAS: Aragorn, nedin dagor hen ú-'erir ortheri. Natha daged dhaer! [Aragorn, they cannot win this fight. They are all going to die!]
ARAGORN: Then I shall die as one of them!
The difference between Aragorn and Legolas isn't hope, it's acceptance of what will come to pass. Legolas despairs, unable to cope with the fact that all of these people, too old or too young to be real soldiers, are headed to their deaths. But Aragorn, knowing they have no choice, is prepared to go to his death as well. It's not that he has hope for victory, but he understands that losing faith at such a dire time will do them no good.
ARAGORN: What is your name?
HALETH: Haleth, son of Hama, my lord. The men are saying we will not live out the night. They say that it is hopeless.
ARAGORN: [He swings Haleth's sword and hands it back to him. This is a good sword Haleth, son of Hama. There is always hope.
Hope in The Two Towers doesn't seem to be about the likelihood of a particular outcome. Aragorn isn't saying, "Hey, we got this, don't sweat it." Instead, hope is a mindset. It's about courage in oneself and faith in your companions. That's why there is always hope, even in the bleakest of moments.
LEGOLAS: We have trusted you this far; you have not led us astray. Forgive me, I was wrong to despair.
Finally Legolas comes around. Notice, he doesn't say, "I decided we totally have a chance with three hundred young boys and old men against ten thousand creatures bred for sole purpose of killing all of us." His hope isn't in the odds; it's in Aragorn, his friend and leader.
GANDALF: The battle for Helm's Deep is over. The battle for Middle-earth is about to begin. All our hopes now lie with two little Hobbits, somewhere in the wilderness.
Gandalf knows that the war against Sauron cannot be won. They prevailed at Helm's Deep, but eventually Sauron will overpower them. They fight only to hold off Sauron until the Ring can be destroyed. All of this fighting, all of this death, it will only matter if the hobbits manage to get the Ring to Mount Doom. Unlikely might be an understatement.