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 (pbuh) 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 Abmad 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-Nihayah, 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 Qur'an. 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.
Is not He [better than your gods] Who responds to the distressed one, when he calls Him... (Qur'an 27: 62)
From Whom do the weak and the oppressed seek victory? Who does everyone beseech? He is Allah. None has the right to be worshipped except Him.
Therefore it is most advisable for you and I to invoke Him during times of both hardship and ease, to seek shelter with Him in difficult times, and to plead at His doorstep with tears of repentance; then will His help and relief quickly arrive.
(Is not He [better than your gods] Who responds to the distressed one, when he calls Him... (Qur'an 27: 62)
He saves the one who is drowning, gives victory to the oppressed, guides the misguided, cures the sick, and provides relief to the afflicted.
And when they embark on a ship, they invoke Allah, making their Faith pure for Him only... (Qur 'an 29: 65)
As for the various supplications one makes to remove hardship, I refer you to the books of the Sunnah. In them, you will learn prophetic supplications with which you can call to Allah, supplicate to Him, and seek His aid. If you have found Him, then you have found everything. And if you lose your faith in Him, then you have lost everything. By supplicating to Him you are performing one of the highest forms of worship. If you are persistent and sincere in your supplication, you will achieve freedom from worry and anxiety. All ropes are cut loose save His, and all doors are shut save His. He is near; He hears all and answers those who supplicate to Him.
If you are living through affliction and pain, remember Allah, call out His name, and ask Him for help. Place your forehead on the ground and mention His praises, so that you can obtain true freedom. Raise your hands in supplication, and ask of Him constantly. Cling to His door, have good thoughts about Him, and wait for His help - you will then find true happiness and success.