Emotions flare up for two reasons: either for joy or for inner Pain. In a hadith, the Prophet (Blessings and Peace be upon him) said: "Verily, I have been prohibited from emitting two foolish and wicked sounds, one that is emitted when something favorable happens, and the other that is expressed when calamity strikes." In order that you may not be sad over matters that you fail to get, nor rejoice because of that which has been given to you. (Qur'an 57: 23) For this reason, the Prophet (bpuh) said: "Verily, true patience is that which is displayed during the initial shock." Therefore, when one contains his emotions upon both the joyful and the calamitous occasion, he is likely to achieve peace and tranquility, happiness and comfort, and the taste of triumph over his own self. Allah described man as being exultant and boastful, irritable, discontented when evil touches him, and niggardly when good touches him. The exceptions, Allah informed us, are those who remain constant in prayer. For they are on a middle path in times of both joy and sorrow. They are thankful during times of ease and are patient during times of hardship. Unbridled emotions can greatly wear a person out, causing pain and loss of sleep. When such a person becomes angry, he flares up, threatens others, loses all self-control, and surpasses the boundaries of justice and balance. Meanwhile, if he becomes happy, he is in a state of rapture and wildness. In his intoxication of joy, he forgets himself and surpasses the bounds of modesty. When he renounces and relinquishes the company of others, he disparages them, forgetting their virtues while stamping out their good qualities. On the other hand, if he loves others, then he spares no pains in according them all forms of veneration and honor, portraying them as being the pinnacles of perfection. The Prophet (bpuh) said:
"Love the one who is beloved to you in due moderation, for perhaps the day will come when you will abhor him. And hate the one whom you detest in due moderation, for perhaps the day will arrive when you will come to love him." And in another hadith, the Prophet (bpuh) said: "And I ask you (O' Allah) to make me just, both while being in a state of anger and while being in a state of Joy. So when a person curbs his emotions, when he controls his mind, and when to each matter he gives according to the weight of its importance, he will have taken a step towards wisdom and true understanding.
Indeed we have sent Our Messengers with clear proofs, and revealed with them the Scripture and the Balance [justice] that mankind may keep up justice. (Qur'an 57: 25)
Indeed, Islam came as much with balance in morals, manners, and dealings as it did with its straightforward, holy, and truthful way of life. Thus we have made you a just [and the best] nation. (Qur 'an 2: 143)
Being just is an end that is called for in both our manners and in matters of jurisprudence. In fact, Islam is founded on truth and justice truthfulness in all that we learn from revealed texts, and justice in rulings, sayings, actions, and manners. And the Word of your Lord has been fulfilled in truth and in justice.) (Qur'an 6: 115)