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:11:116

So why were there not among the generations before you those of enduring discrimination forbidding corruption on earth - except a few of those We saved from among them? But those who wronged pursued what luxury they were given therein, and they were criminals.  

If only there had been among the generations, past communities, before you men possessing a remnant ˹of good sense˺, men of religion and virtue, forbidding corruption in the earth (this ˹statement˺ is intended to be a negation, in other words, ‘there never were such ˹men˺ among them’), except, but, a few of those whom (mimman: min is explicative) We delivered from among them, did forbid ˹corruption˺ and were thus delivered. But those who did wrong, through corruption and neglecting to forbid, followed that by which they were made profligate, and were sinners.
القرآن:١١:١١٦

فَلَوْلَا كَانَ مِنَ الْقُرُونِ مِنْ قَبْلِكُمْ أُولُو بَقِيَّةٍ يَنْهَوْنَ عَنِ الْفَسَادِ فِي الْأَرْضِ إِلَّا قَلِيلًا مِمَّنْ أَنْجَيْنَا مِنْهُمْ ۗ وَاتَّبَعَ الَّذِينَ ظَلَمُوا مَا أُتْرِفُوا فِيهِ وَكَانُوا مُجْرِمِينَ  

{فلولا} فهلا {كان من القرون} الأمم الماضية {من قبلكم أولو بقية} أصحاب دين وفضل {ينهون عن الفساد في الأرض} المراد به النفي: أي ما كان فيهم ذلك {إلا} لكن {قليلا ممن أنجينا منهم} نهوا فنجوا ومن للبيان {واتبع الذين ظلموا} بالفساد وترك النهي {ما أترفوا} نعموا {فيه وكانوا مجرمين}.