Talmud - Mas. Berachoth 60b
R. Huna said in the name of Rab citing R. Meir, and so it was taught in the name of R. Akiba: A man should always accustom himself to say Whatever the All-Merciful does is for good, [as exemplified in] the following incident. R. Akiba was once going along the road and he came to a certain town and looked for lodgings but was everywhere refused. He said Whatever the All-Merciful does is for good, and he went and spent the night in the open field. He had with him a rooster, an donkey and a lamp. A gust of wind came and blew out the lamp, a weasel came and ate the rooster, a lion came and ate the donkey. He said: Whatever the All-Merciful does is for good. The same night some brigands came and carried off the inhabitants of the town. He said to them: Did I not say to you, Whatever the All-Merciful does is all for good?
In this account, Rabbi Akiba's very life was at stake and through the sequence of events that happened, his life was spared. Had the rooster been there, Rabbi Akiba would surely have been given away by the sound of the animal. Had his lamp not gone out, he would have been plundered in in the night. But how many of us go through similar roundabouts in life and become incensed, outraged or completely undone? While it is true that manifesting this type of equanimity takes muscle, the first steps toward this type of control is to declare that "whatever the All-Merciful does is all for good." By this recognition that all things come from Hashem, we first put our King in His rightful place. We demote ourselves and and submit that there is a masterful Ruler. In this way, to become angry from then on truly becomes an act of idol-worship; for it we declare that Hashem is master of all and then become angry with our circumstances, we are not accepting Him as the Holy One, our Master. Through this destructive emotion, we negate that He is working in our lives in mysterious and wonderful ways. We instead, through our anger, place ourselves in the seat of the Divine and declare that we are in charge. Not only does this seem absurd, it is ineffective in changing our circumstances and many times leads to more calamities.
The next time you feel you are at the brink of anger and ready to lash out at those around you for what appears to be the world-not-going-according-to-your-way, recall the All-Merciful One to Whom you pray daily. Place Him at the forefront of the situation, reconsider what is going on around you, and look for the good that is inherently present in all that comes upon you. For while it may not immediately known, all that is given, seemingly good or bad, is also for the good.