The ending of From Here to Eternity is pretty dang grim. Prewitt courageously risks life and limb to rejoin his fellow soldiers after the Pearl Harbor attack breaks out. (Meanwhile, Warden is commanding a machine gun and firing at Japanese planes.) But Prewitt, of course, dies—even though the Japanese never tried to invade Hawaii on foot, a U.S. soldier mistakes Prewitt for an ejected Japanese pilot and guns him down.
Prewitt dies an ironic death, accidentally shot by his own comrades after he'd triumphed over so much adversity from the army itself. He's killed by the army while attempting to rejoin it. But it's still a heroic death, since it demonstrates his real qualities as a man and a soldier.
Warden pays tribute to Prewitt as he looks at his dead body:
"Sir, this man was a good soldier. He loved the Army more than any soldier I ever knew. I would like to make a formal request that this body be buried in the Army's permanent cemetery at Schofield Barracks."
In the final scene, we see Karen Holmes and Alma Burke together on a ship, leaving Hawaii. They talk about how beautiful Hawaii is, and how depressed they are. Karen says that the leis, the flower garlands they've dropped into the ocean, will predict their return if they float back toward the island. If they float out to sea, Karen and Alma won't come back.
Alma tells her that her fiancé died in the attack—stretching the truth a bit, since she said she didn't want to marry Prewitt. But when Karen hears Prewitt's name, she's struck by it, since she presumably knows the full truth of the story, as opposed to the romanticized version Alma is giving her. (Alma says Prewitt was a pilot who died in combat.)
In the movie's final image we see the garlands floating. It's left as a mystery where they're headed, and whether Karen or Alma will ever return. Originally, Daniel Taradash's screenplay had the garlands floating out to sea, but in the movie it's not clear where they're headed. A return—and a potential reunion between Karen and Warden—is left open as a possibility.