Bhagavad Gita · 2.47
कर्मण्येवाधिकारस्ते मा फलेषु कदाचन।मा कर्मफलहेतुर्भूर्मा ते सङ्गोऽस्त्वकर्मणि॥
karmaṇy evādhikāras te mā phaleṣhu kadāchana mā karma-phala-hetur bhūr mā te saṅgo 'stv akarmaṇi
You have a right to perform your duty, but you are not entitled to the fruits of your actions. Never consider yourself the cause of the results of your activities, nor be attached to inaction.
— Bhagavad Gita 2.47
Source: Sacred-Texts.com (Sanskrit) + Bhagavad-Gita.io (translations)