This is a really amazing wisdom offered in Yoga Vasistha by Maharishi Vasistha to Shri Ram.
… Wise man’s friend, O Rama, is his own action which arises spontaneously in him and in which there is no division or conflict. LIke a father, it encourages him and provides him with enthusiasm. LIke a wife, it checks him, restrains him and guides him. It does not abandon him even in the worst calamities. It is free from doubt. It promotes the spirit of renunciation. Because it turns anger and hate upon themselves, it is like quaffing nectar. It is his friend and helper even in the densest forest of troubles and difficulties. It is the treasure chest which contains the precious gems of faith.
The friend (one’s own action) has sons who are known as bathing (purity of body), charity, austerity and meditation. They, too, promote the welfare and happiness of all beings. The spirit of happiness (or a happy spirit) is its wife who showers happiness on all naturally and effortlessly. Her name is Samata (Equanimity or even-ness of mind). She encourages her husband (natural action) in the performance of righteous or appropriate action.
She has another constant companion known as maitri (friendliness).
The wise man who enjoys the company of this best of all friends with its wife and other companions has (i) no need to rejoice when he is in joy or pleasure or grieve when in unpleasant situation. (ii) He does not hate not become angered. (iii) Wherever and in whatever condition he is, he enjoys the state of nirvana, though he is constantly engaged in the activities of the world. (iv) He is silent in useless arguments, he is deaf to useless talk, he is a corpse in relation to unrighteous action, (v) he is very much alive in righteous action, (vi) he is brilliant in exposing what is auspicious and in a moment he reveals the greatest truth.
All this is natural to the wise man. He does not have to strive to acquire these qualities.