One should die proudly when it is no longer possible to live proudly.
 Friedrich Nietzsche, Twilight of the Idols (1889). copy citation

add
Author Friedrich Nietzsche
Source Twilight of the Idols
Topic living
Date 1889
Language English
Reference
Note Translated by Anthony M. Ludovici
Weblink https://www.gutenberg.org/files/52263/52263-h/52263-h.htm

Context

“A new responsibility should be created, that of the doctor—the responsibility of ruthlessly suppressing and eliminating degenerate life, in all cases in which the highest interests of life itself, of ascending life, demand such a course—for instance in favour of the right of procreation, in favour of the right of being born, in favour of the right to live. One should die proudly when it is no longer possible to live proudly. Death should be chosen freely,—death at the right time, faced clearly and joyfully and embraced while one is surrounded by one's children and other witnesses. It should be affected in such a way that a proper farewell is still possible, that he who is about to take leave of us is still himself, and really capable not only of valuing what he has achieved and willed in life, but also of summing-up the value of life itself.” source