Bhagavad Gita 3.35
श्रेयान्स्वधर्मो विगुणः परधर्मात्स्वनुष्ठितात् ।
स्वधर्मे निधनं श्रेयः परधर्मो भयावहः ॥ ३५ ॥
Better one's own duty, though destitute of merit, than the duty of another, well discharged. Better death in the discharge of one's own duty; the duty of another is full of danger.
Sanskrit text and English translation: Annie Besant, The Bhagavad-Gita, 4th edition (1922) — public domain, via Wikisource. Chapter summaries: SamayaVeda.