Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:42:30

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

And whatever affliction, ˹whatever˺ misfortune or hardship, may befall you — ˹this is˺ an address to the believers — is on account of what your ˹own˺ hands have earned, that is to say, ˹for˺ the sins that you have committed — the use of ‘hands’ to express this is because most actions are effected by them. And He pardons much, of these ˹sins˺ and does not requite them, for God’s kindness is greater than that He should ˹for example˺ double the requital in the Hereafter; as for those who do not commit ˹grave˺ sins, then what befalls them in this world ˹of hardship˺ raises their degree in the ˹reward of the˺ Hereafter.
القرآن:٤٢:٣٠

وَمَا أَصَابَكُمْ مِنْ مُصِيبَةٍ فَبِمَا كَسَبَتْ أَيْدِيكُمْ وَيَعْفُو عَنْ كَثِيرٍ  

{وما أصابكم} خطاب للمؤمنين {من مصيبة} بلية وشدة {فبما كسبت أيديكم} أي كسبتم من الذنوب وعبر بالأيدي لأن أكثر الأفعال تزاول بها {ويعفو عن كثير} منها فلا يجازي عليه وهو تعالى أكرم من أن يثني الجزاء في الآخرة، وأما غير المذنبين فما يصيبهم في الدنيا لرفع درجاتهم في الآخرة.