Imaam ibn Al Qayyim said:
“The ibtilaa’ (testing) of the believer is like medicine for him. It extracts from him the illnesses. Had the illness remained it would destroy him or diminish his reward and level (in the hereafter). The tests and the trials extract these illnesses from him and prepare him for the perfect reward and the highest of degrees (in the life to come).”
Calamities, trials and tests are signs of love from Allaah for the believers. They are comparable to a cure; although it may be bitter, you accept it because it is from the one whom you love; and to Allaah belongs the best example.
Ibn Al-Qayyim’s Book: “Ighaathatul Lahfan” p. 286.