Earthquakes are one of the great signs of Allaah in this universe, with which He tests His slaves as a reminder or to instil fear of Him or as a punishment. Man must remember, when the signs occur, his weakness, incapability, humble status before Allaah and his need of Him, so he turns to Allaah, may He be exalted and glorified, in supplication, beseeching and humility, in the hope that Allaah will lift this great distress from the people.
Allaah says (interpretation of meaning):
“Verily, We sent (Messengers) to many nations before you (O Muhammad صلى الله عليه وسلم). And We seized them with extreme poverty (or loss in wealth) and loss in health (with calamities) so that they might humble themselves (believe with humility).
43. When Our Torment reached them, why then did they not humble themselves (believe with humility)? But their hearts became hardened, and Shaytaan (Satan) made fair‑seeming to them that which they used to do.
44. So, when they forgot (the warning) with which they had been reminded, We opened for them the gates of every (pleasant) thing, until in the midst of their enjoyment in that which they were given, all of a sudden, We took them (in punishment), and lo! They were plunged into destruction with deep regrets and sorrows”
[al-An’aam 6:42-44]