Bhagavad Gita

ದುಃಖೇಷ್ವನುದ್ವಿಗ್ನಮನಾಃ ಸುಖೇಷು ವಿಗತಸ್ಪೃಹಃ।
ವೀತರಾಗಭಯಕ್ರೋಧಃ ಸ್ಥಿತಧೀರ್ಮುನಿರುಚ್ಯತೇ ॥೫೬॥
duḥkheṣvanudvignamanāḥ sukheṣu vigataspṛhaḥ|
vītarāgabhayakrodhaḥ sthitadhīrmunirucyate ||56||

Gist of the sloka:
One who does not collapse when hit with difficulty, one who does not jump with joy when he obtains happiness, nor does he have any desire, fear, anger is called stitha-pragna.
In life, happiness and grief is like day and night. It’s inevitable and constant. It never leaves anyone alone either. Everyone has to undergo these cycles. There are times when difficulties occur one after another without any gap in-between for relief. Similarly, happiness happens without any warning. We cannot stop difficulty by money nor purchase happiness with money. One should therefore keep calm during the varied situations and proceed with the strong belief in the Lord.
Normally when hit with difficulty, we lose our mental calmness which result in bodily harm/diseases. What is inevitable, one should not lament. For crying for such a situation, would not decrease or eliminate the issue. We should realize that difficult situation is in preparation for upcoming happiness and happiness is in preparation for difficult situation.
It is not that one should not feel happy when the happiness occurs but rather one should not forget oneself when these situations happens. For change of situation is inevitable. One should train the mind to be in equilibrium, when the situations changes, for it’s a cyclic event.
While it is easy to say one should keep the mind in a steady frame and harden it for the events, it’s not easy to practice. The good example of this is when Abhimanyu was killed in the war days after Lord instructed Arjuna. Arjuna collapsed with grief, when he heard of his son’s death.
One should always keep away from these 3 states. Raga-Bhaya-Krodha. Intense desire causes raga [desire]. When the desired object is not obtained it causes grief/disappointment. If the desired object is obtained by a less powerful person, than anger [Krodha]. If it’s obtained by a powerful person then fear [Bhaya]. These are all the games/states in the mind.
Like Lord Vyasa says “In this world nothing has happened which was not intended by the Lord and will not happen in future”. Everything happens because the Lord willed it. It is of little use to worry about the events for it affects the achievement of state of stitha-pragna.
The word Muni means one who has overcome desire and anger. Therefore, one should try to achieve mental equilibrium. Here Lord Krishna is trying to instruct Arjuna to achieve the qualities of a Muni.