This is from Star Trek: The Next Generation, “The Best of Both Worlds, Part II.”
The crew is preparing for what they believe to be a hopeless battle. They have just lost their captain and while they like and trust their new captain (formerly 1st Officer Will Riker), they don’t believe there’s anything they can do to save themselves. Whoopi Goldberg plays Guinan, a wise bartender whose face belies her hundreds of years. She speaks to Riker in the captain’s ready room.
When a man is convinced he’s going to die tomorrow, he’ll probably find a way to make it happen.