Bhagavad Gita 18.9
He who performs an obligatory action, believing it to be a duty that ought to be done, without any personal desire to do the act or to receive any return—such renunciation is pure.
कार्यमित्येव यत्कर्म नियतं क्रियतेऽर्जुन।सङ्गं त्यक्त्वा फलं चैव स त्यागः सात्त्विको मतः॥kāryamityeva yatkarma niyataṃ kriyate'rjuna|saṅgaṃ tyaktvā phalaṃ caiva sa tyāgaḥ sāttviko mataḥ||
English translation (above): Shri Purohit Swami (1935), public domain. Sanskrit text via github.com/gita/gita (Unlicense).