Chapter 5 · The Yoga of Renunciation · Krishna said
Bhagavad Gita 5.20 — Steady in joy and sorrow
न प्रहृष्येत्प्रियं प्राप्य नोद्विजेत्प्राप्य चाप्रियम्। स्थिरबुद्धिरसम्मूढो ब्रह्मविद् ब्रह्मणि स्थितः ॥
na prahṛṣyetpriyaṃ prāpya nodvijetprāpya cāpriyam | sthirabuddhirasammūḍho brahmavid brahmaṇi sthitaḥ ||
Meaning
One who does not rejoice too much on getting what is pleasant nor get upset by the unpleasant — steady, undeluded, knowing Brahman — is established in Brahman.