Bhagavad Gita · 7.16
चतुर्विधा भजन्ते मां जनाः सुकृतिनोऽर्जुन।आर्तो जिज्ञासुरर्थार्थी ज्ञानी च भरतर्षभ॥
chatur-vidhā bhajante māṁ janāḥ su-kṛtino 'rjuna ārto jijñāsur arthārthī jñānī cha bharatarṣhabha
O best of the Bharatas, four kinds of virtuous people worship Me: the distressed, the seeker of knowledge, the seeker of wealth, and the wise.
— Bhagavad Gita 7.16
Source: Sacred-Texts.com (Sanskrit) + Bhagavad-Gita.io (translations)