There is a shloka in Hinduism that might be relevant to this post. As stated in Mahabharata, when Arjun wonders about the futility of his efforts on the battlefields of Kurukshetra, this is what Lord Krishna says to him:
"कर्मण्येवाधिकारस्ते मा फलेषु कदाचन। मा कर्मफलहेतुर्भूर्मा ते संगोऽस्त्वकर्मणि॥"
(You have the right to perform your actions, but you are not entitled to the fruits of the actions. Do not let the fruit be the purpose of your actions, and therefore you won’t be attached to not doing your duty.)