Bhagavad Gita · 17.19
मूढग्राहेणात्मनो यत्पीडया क्रियते तपः।परस्योत्सादनार्थं वा तत्तामसमुदाहृतम्॥
mūḍha-grāheṇātmano yat pīḍayā kriyate tapaḥ parasyotsādanārthaṁ vā tat tāmasam udāhṛitam
Austerity performed with foolish stubbornness, through self-torture, or for the purpose of harming others — that is declared to be in the mode of ignorance.
— Bhagavad Gita 17.19
Source: Sacred-Texts.com (Sanskrit) + Bhagavad-Gita.io (translations)