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:28:59

And never would your Lord have destroyed the cities until He had sent to their mother a messenger reciting to them Our verses. And We would not destroy the cities except while their people were wrongdoers.  

And your Lord never destroyed the towns, because of evildoing on their part, until He had raised up in their mother-town, that is, the major ˹town˺ among them, a messenger to recite Our signs to them. And We never destroyed the towns unless their inhabitants were committing evil, by denying the messengers.
القرآن:٢٨:٥٩

وَمَا كَانَ رَبُّكَ مُهْلِكَ الْقُرَىٰ حَتَّىٰ يَبْعَثَ فِي أُمِّهَا رَسُولًا يَتْلُو عَلَيْهِمْ آيَاتِنَا ۚ وَمَا كُنَّا مُهْلِكِي الْقُرَىٰ إِلَّا وَأَهْلُهَا ظَالِمُونَ  

{وما كان ربك مهلك القرى} بظلم منها {حتى يبعث في أمها} أي أعظمها {رسولا يتلوا عليهم آياتنا وما كنا مهلكي القرى إلا وأهلها ظالمون} بتكذيب الرسل.