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:29:40

So each We seized for his sin; and among them were those upon whom We sent a storm of stones, and among them were those who were seized by the blast ˹from the sky˺, and among them were those whom We caused the earth to swallow, and among them were those whom We drowned. And Allah would not have wronged them, but it was they who were wronging themselves.  

So each, of those mentioned, We seized for his sin; and among them were some upon whom We unleashed a squall of stones, as in the case of the people of Lot, and among them were some who were seized by the Cry, such as Thamūd, and among them were some whom We made the earth swallow, such as Korah, and among them were some whom We drowned, like the people of Noah, Pharaoh and his people. And God never wronged them, by chastising them for ˹having committed˺ no sin, but they wronged themselves, by committing sins.
القرآن:٢٩:٤٠

فَكُلًّا أَخَذْنَا بِذَنْبِهِ ۖ فَمِنْهُمْ مَنْ أَرْسَلْنَا عَلَيْهِ حَاصِبًا وَمِنْهُمْ مَنْ أَخَذَتْهُ الصَّيْحَةُ وَمِنْهُمْ مَنْ خَسَفْنَا بِهِ الْأَرْضَ وَمِنْهُمْ مَنْ أَغْرَقْنَا ۚ وَمَا كَانَ اللَّهُ لِيَظْلِمَهُمْ وَلَٰكِنْ كَانُوا أَنْفُسَهُمْ يَظْلِمُونَ  

{فكلا} من المذكورين {أخذنا بذنبه فمنهم من أرسلنا عليه حاصبا} ريحاً عاصفة فيها حصباء كقوم لوط {ومنهم من أخذته الصيحة} كثمود {ومنهم من خسفنا به الأرض} كقارون {ومنهم من أغرقنا} كقوم نوح وفرعون وقومه {وما كان الله ليظلمهم} فيعذبهم بغير ذنب {ولكن كانوا أنفسهم يظلمون} بارتكاب الذنب.