What to Say When Calamity Strikes You
Question

If a calamity befalls the Muslim in his health or his wealth, etc, what is the correct way of dealing with it according to Islam?
Praise be to Allah.Calamities and disasters are a test
Calamities and disasters are a test, and they are a sign of Allah’s love for a person, because they are like medicine: even though it is bitter, despite its bitterness you give it to the one whom you love – and for Allah is the highest description. In the authentic Hadith it says: “The greatest reward comes with the greatest trial. When Allah loves a people He tests them. Whoever accepts that wins His pleasure but whoever is discontent with that earns His wrath.” (Narrated by At-Tirmidhi, 2396 and Ibn Majah, 4031; classed as sound by Al-Albani in Sahih At-Tirmidhi)
Are calamities good for the believer?
Calamities are good for the believer in the sense that reward is stored up for him the Hereafter thereby; how can it be otherwise when he is raised in status thereby and his bad deeds are expiated? The Prophet (peace and blessings of Allah be upon him) said: “When Allah wills good for His slave, He hastens the punishment for him in this world, and when Allah wills ill for His slave, he withholds the punishment for his sins from him until he comes with all his sins on the Day of Resurrection.” (Narrated by At-Tirmidhi, 2396; classed as authentic by Al-Albani in Sahih At-Tirmidhi)
Al-Hasan Al-Basri (may Allah have mercy on him) said: “Do not resent the calamities that come and the disasters that occur, for perhaps in something that you dislike will be your salvation, and perhaps in something that you prefer will be your doom.”
Al-Fadl ibn Sahl (may Allah have mercy on him) said: “There is a blessing in calamity that the wise man should not ignore, for it erases sins, gives one the opportunity to attain the reward for patience, dispels negligence, reminds one of blessings at the time of health, calls one to repent and encourages one to give charity.
Through calamity the believer seeks reward, and there is no way to attain it but through patience, and there is no way to be patient except with resolute faith and strong will.
Remember the words of the Messenger (peace and blessings of Allah be upon him): “How wonderful is the affair of the believer, for his affairs are all good, and this applies to no one but the believer. If something good happens to him, he is thankful for it and that is good for him. If something bad happens to him, he bears it with patience and that is good for him.” (Narrated by Muslim, 2999)
What to Say When Calamity Strikes You
So if calamity befalls a Muslim, he should say Inna Lillahi wa inna ilayhi raji`un (Verily to Allah we belong and unto Him is our return), and say the Du`a’s that have been narrated from the Prophet (peace and blessings of Allah be upon him).
How wonderful are those moments in which a person turns to his Lord and knows that He alone is the One Who grants relief from distress. How great is the relief when it comes after hardship. Allah says (interpretation of the meaning):
{but give glad tidings to As- Sabirun (the patient).  Who, when afflicted with calamity, say: ‘Truly, to Allah we belong and truly, to Him we shall return.’ They are those on whom are the Salawat (i.e. who are blessed and will be forgiven) from their Lord, and (they are those who) receive His Mercy, and it is they who are the guided ones.} [Al-Baqarah 2:155-157]
Muslim (918) narrated that Umm Salamah (may Allah be pleased with her) said: I heard the Messenger of Allah (peace and blessings of Allah be upon him) say: “There is no Muslim who is stricken with a calamity and says what Allah has enjoined – ‘Verily to Allah we belong and unto Him is our return. O Allah, reward me for my affliction and compensate me with something better’ – but Allah will compensate him with something better.”
She said: When Abu Salamah died, I said: Who among the Muslims is better than Abu Salamah, the first household to migrate to join the Messenger of Allah (peace and blessings of Allah be upon him)? Then I said it, and Allah compensated me with the Messenger of Allah (peace and blessings of Allah be upon him).
How to deal with calamities
There are things which, if the one who is stricken with calamity thinks about them, that will make the calamity easier for him to bear.
In his valuable book Zad Al-Ma`ad (4/189-195), Ibn Al-Qayyim has mentioned several things, including the following:

If he looks at what has befallen him, he will find that what his Lord has left for him is similar to it or better than it, and if he is patient and accepts it, He has stored up for him something that is many times greater than what he has lost through this calamity, and if He willed He could have made the calamity even greater.
The fire of calamity can be extinguished by thinking of those who have been hit even harder. Let him look to his right, does he see anything but calamity? Then let him look to his left, does he see anything but loss? If he were to look at the people around him, he would not see anything but people who are tested, either by missing out on something that they like, or by having something happen to them that which they dislike. The pains of this world are like dreams or like a passing shadow. If you laugh a little you will weep a lot, and if you are happy for a day you will be miserable for a lifetime, and if you have what you want for a little while, you will be deprived for a long time. There is no day of happiness but it is followed by a day of pain. Ibn Mas`ud (may Allah be pleased with him) said: For every moment of joy there is a moment of sorrow, and no house is filled with joy but it will be filled with sorrow. And Ibn Sirin (may Allah have mercy on him) said: There is never any laughter but there comes weeping after it.
It should be noted that panicking will not make the calamity go away, and in fact it makes it worse.
It should be noted that missing out on the reward for patience and surrender, which is mercy and guidance that Allah has granted as the reward for patience and turning to Him (by saying Inna Lillahi wa inna ilayhi raji`un (Verily to Allah we belong and unto Him is our return)), is worse than the calamity itself.
It should be noted that panicking makes one’s enemy rejoice and makes one’s friend feel sad; it makes Allah angry and makes the devils happy; it destroys reward and weakens resolve. If he is patient, seeks reward, strives to please Allah, to make his friend happy and to make his enemy sad, and seeks to relieve his brothers of their burdens and to console them before they console him, this is steadfastness and a sign of perfection – not slapping one’s cheeks, rending one’s garment, wishing for death and being discontent with the divine decree.
It should be noted that what comes after being patient and seeking reward is pleasure and joy that is many times greater than what he could have got from keeping what he lost. Sufficient for him is the “house of praise” that will be built for him in Paradise as a reward for his praising his Lord and turning to Him (by saying Inna Lillahi wa inna ilayhi raji`un (Verily to Allah we belong and unto Him is our return)). So let him decide which of the two calamities is greater: a calamity in this world, or the calamity of missing out on the house of praise in eternal Paradise.  In At-Tirmidhi it is narrated in a report that is attributed to the Prophet  (peace and blessings of Allah be upon him): “On the Day of Resurrection people will wish that their skins had been cut with scissors in this world, when they see the reward of those who were struck with calamity.” One of the salaf said: Were it not for the calamities of this world, we would come empty-handed on the Day of Resurrection.
It should be noted that the One Who is testing him is the Most Wise and the Most Merciful, and that He – may He be glorified – did not send this calamity in order to destroy him or cause him pain or finish him off, rather He is checking on him, testing his patience, acceptance and faith; it is so that He may hear his Du`a’ and supplication, so that He may see him standing before Him, seeking protection, filled with humility and complaining to Him.
It should be noted that were it not for the trials and tribulations of this world, a person could develop arrogance, self-admiration, a pharaonic attitude and hardheartedness which would lead to his doom in this world and in the Hereafter. It is a sign of the mercy of the Most Merciful that He checks on him from time to time with the remedy of calamity so as to protect him from these diseases, to keep his submission and servitude sound, and to eliminate all bad elements that may lead to his doom. Glory be to the One Who shows mercy by means of testing, and tests by means of blessing, as it is said:

Allah may bless us with calamities even if that is hard, and Allah may test some people with blessings.

It should be noted that the bitterness of this world is the essence of sweetness in the Hereafter, as Allah will turn the former into the latter. Similarly the sweetness of this world is the essence of bitterness in the Hereafter. It is better to move from temporary bitterness to eternal sweetness than the other way round. If this is still not clear to you, then think of what the Prophet (peace and blessings of Allah be upon him) said: “Paradise is surrounded with difficulties, and Hell is surrounded with desires.”

What happens if you respond well to calamity?
In many cases, if a person responds well to calamity, they understand that it is a blessing and a gift, not a test.
Shaykh Al-Islam [Ibn Taymiyah] (may Allah have mercy on him) said: “A calamity that makes you turn to Allah is better for you than a blessing which makes you forget the remembrance of Allah.”
Sufyan (may Allah have mercy on him) said: “What a person dislikes may be better for him than what he likes, because what he dislikes causes him to call upon Allah, whereas what he likes may make him heedless.”
Ibn Taymiyah (may Allah have mercy on him) regarded his imprisonment as a blessing that had been caused by his enemies.
Ibn Al-Qayyim (may Allah have mercy on him) said: “One day he – meaning Ibn Taymiyah – said to me: What can my enemies do to me? My garden is in my heart; wherever I go it is with me and never leaves me. My detainment is seclusion (an opportunity for worship), my being killed is martyrdom, and being expelled from my city is a journey.
He used to say of his detainment in the citadel: If I were to spend the fill of this citadel in gold, that would not be sufficient to express my gratitude for this blessing. Or he said: That would not be sufficient to reward them for what they have brought to me of goodness.
When he was imprisoned, he used to say when prostrating: “O Allah, help me to remember You, give thanks to You and to worship You well. Ma sha Allah. He said to me (Ibn Al-Qayyim) one day: The one who is really detained is the one who keeps his heart away from his Lord, and the real prisoner is the one who is captive to his whims and desires. When he entered the citadel and was within its walls, he looked at it and said: {So a wall will be put up between them, with a gate therein. Inside it will be mercy, and outside it will be torment} [Al-Hadid 57:13]. Allah knows that I have never seen anyone who was more content with his life than him, despite all the hardship that he experienced, and the lack of luxury and comfort, in fact the opposite of that, and despite the imprisonment, threats and exhaustion that he faced; despite all of that, he was the happiest of people with his life, the most content, the most courageous, the most satisfied. You could see the signs of joy and happiness in his face. When we felt afraid and were expecting calamity, and we had nowhere to turn, we would go to him and as soon as we saw him and heard his voice, all those fears disappeared and were replaced with contentment, courage, certainty and tranquillity. Glory be to the One who showed some of His slaves His Paradise before they met Him, and opened its gates to them when they were still in this world of deeds and actions, so some of its breezes and fragrance came to them, which made them devote their energy to seeking it and competing in attaining it.” (End quote from Al-Wabil As-Sayyib, p. 110)
And Allah knows best.