An intelligent and skillful person transforms losses into profits; whereas, the unskilled person aggravates his own predicament, often making two disasters out of one.
The Prophet (bpuh) was compelled to leave Makkah, but rather than quit his mission, he continued it in Madeenah - the city that took its place in history with lightning speed.
Imam Ahmad ibn Hanbal was severely tortured and flogged, and yet he emerged triumphant from that ordeal, becoming the Imam of the Sunnah. Imam Ibn Taymiyah was put into prison; he later came out an even more accomplished scholar than he was before. Imam As-Sarakhsi was held as a prisoner, kept at the bottom of an unused well; he managed therein to produce twenty volumes on Islamic jurisprudence. Ibn Atheer became crippled, after which he wrote Jam'ey al-Usool and An-Nihoyoh, two of the most famous books in the Science of Hadith. Imam Ibn al-Jawzi was banished from Baghdad. Then, through his travels, he became proficient in the seven recitations of the Quran. Maalik ibn ar-Rayb was on his deathbed when he recited his most famous and beautiful poem, which is appreciated until this day. When Abi Dhu'aib al-Hadhali's children died before him, he eulogized them with a poem that the world listened to and admired.
Therefore, if you are afflicted with a misfortune, look on the bright side. If someone were to hand you a glass full of squeezed lemons, add to it a handful of sugar. And if someone gives you a snake as a gift, keep its precious skin and leave the rest.
(And it may be that you dislike a thing that is good for you)
(Qur'an 2: 216)
Before its violent revolution, France imprisoned two brilliant poets: one an optimist, the other a pessimist. They both squeezed their heads through the bars of their cell windows. The optimist then stared at the stars and laughed, while the pessimist looked at the dirt of a neighboring road and wept. Look at the other side of a tragedy ---- a circumstance of pure evil does not exist, and in all situations one can find goodness and profit and reward from Allah.