Karmany evadhikaras te ma phaleshu kadachana. In a standard translation: “You have a right to perform your prescribed duty, but you are not entitled to the fruits of action.”
The line is verse 47 of the second chapter of the Bhagavad Gita. Krishna speaks it to Arjuna on the battlefield.