Trials and calamities are a test.
According to hadith:
“The greatest reward comes with the greatest trial, when ALLAH loves people he tests them. Whoever accepts the trials, WINS ALLAH’s pleasure, but whoever discontent with that, earns ALLAH’s wrath!”
Narrated by Al Tirmidhi-2396, Ibn Maajah-4031!