Groundwork of the Metaphysics of Morals
Immanuel Kant · 1785
"An action is morally right only if it's done from duty according to a principle you could will to become a universal law for everyone — the categorical imperative — consequences are irrelevant; what matters is whether the underlying rule you're acting on treats people as ends in themselves, never merely as means."
Kant's deontology, from the Greek deon, duty, is a direct rejection of consequentialism: an action's moral worth comes entirely from the principle, or maxim, behind it and whether that principle could be universalized, not from how the action turns out. His categorical imperative gives a test: act only according to a maxim you could, at the same time, will to become a universal law — if a rule fails when everyone follows it, like lying to get out of a promise, which collapses the entire concept of promising if universalized, the action is impermissible regardless of the good outcome it might produce in your specific case.
Read more about the topic
Meditations
"Peace of mind comes from rigorously separating what's in your control — your judgments, intentions, reactions — from what isn't — external events, other people, outcomes, even your own body — and directing all effort at the former while accepting the latter without resistance."