Bhagavad Gita 16.23
Chapter 16: Divine and demonic natures
यः शास्त्रविधिमुत्सृज्य वर्तते कामकारतः ।
न स सिद्धिमवाप्नोति न सुखं न परां गतिम् ॥ २३ ॥
He who, having cast aside the ordinances of the Scriptures, followeth the promptings of desire, attaineth not to perfection, nor happiness, nor the highest goal.
Sanskrit text and English translation: Annie Besant, The Bhagavad-Gita, 4th edition (1922) — public domain, via Wikisource. Chapter summaries: SamayaVeda.