The Metaphysics of Morals by Immanuel Kant Chapter 1 Page 14

duty nor from direct inclination, but merely with a selfish view.

On the other hand, it is a duty to maintain one's life; and, in addition, everyone has also a direct inclination to do so. But on this account the often anxious care which most men take for it has no intrinsic worth, and their maxim has no moral import. They preserve their life as duty requires, no doubt, but not because duty requires. On the other hand, if adversity and hopeless sorrow have completely taken away the relish for life; if the unfortunate one, strong in mind, indignant at his fate rather than desponding or dejected, wishes for death, and yet preserves his life without loving it- not from inclination or fear, but from duty- then his maxim has a moral worth.

To be beneficent when we can is a duty; and besides