Lord Krishna in Bhagawad Gita says this to Arjuna – Karmanye Vadhikaraste Ma Phaleshou Kada Chana Ma Karma Phala Hetur Bhurmatey Sangostva Akarmani]. This means that you have the right to work only but never to its fruits. Let not the fruits of action be your motive, nor let your attachment be to inaction. (details here). It is your dharma that drives you to do the work and not the fruits that are expected as the outcome of the work.
कर्मण्येवाधिकारस्ते मा फलेषु कदाचन। मा कर्मफलहेतुर्भूर्मा ते सङ्गोऽस्त्वकर्मणि॥
As we progress in life, it is worthwhile remembering this verse and reduce worrying about the fruits of our work or fail to take action due to our attachments. For most of us living in material world it is nearly easy to get to this state completely. But by choosing this direction, we can dissociate ourselves from the fruitis of the action and focus on performing actions/work as required by your dharma.
[image taken from www.hindibhajan.in/karmanye-vadhikaraste-shloka-lyrics/]