CAESAR: Cowards die many times before their deaths;
The valiant never taste of death but once.
Of all the wonders that I yet have heard,
It seems to me most strange that men should fear,
Seeing that death, a necessary end,
Will come when it will come.William Shakespeare (1564-1616) English dramatist and poet
Julius Caesar, Act 2, sc. 2, l. 34ff (2.2.34-39) (1599)
(Source)
The initial phrase has seemingly morphed in the retelling, though still being cited to Shakespeare: "A coward dies a thousand times before his death, but the valiant taste of death but once." This is the form most often seen, but is not Shakespeare.
In A Farewell to Arms (1929), Hemingway gives another paraphrase: "The coward dies a thousand deaths, the brave but one." This, too, sometimes gets modified to make it scan better, e.g., "A coward dies a thousand deaths, the brave dies only once."