Dalil

Quran Ash-Shuraa 42:30

وَمَآ أَصَٰبَكُم مِّن مُّصِيبَةٖ فَبِمَا كَسَبَتۡ أَيۡدِيكُمۡ وَيَعۡفُواْ عَن كَثِيرٖ

Translation

And whatever strikes you of disaster - it is for what your hands have earned; but He pardons much.