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:6:42

And We have already sent ˹messengers˺ to nations before you, ˹O Muhammad˺; then We seized them with poverty and hardship that perhaps they might humble themselves ˹to Us˺.  

Indeed We sent to communities before you (min qablika: min is extra), messengers, but they denied them, and We seized them with misery, abject poverty, and hardship, illness, so that they might be humble, abased, that they might believe.
القرآن:٦:٤٢

وَلَقَدْ أَرْسَلْنَا إِلَىٰ أُمَمٍ مِنْ قَبْلِكَ فَأَخَذْنَاهُمْ بِالْبَأْسَاءِ وَالضَّرَّاءِ لَعَلَّهُمْ يَتَضَرَّعُونَ  

{ولقد أرسلنا إلى أمم من} زائدة {قبلك} رسلا فكذبوهم {فأخذناهم بالبأساء} شدة الفقر {والضراء} المرض {لعلهم يتضرعون} يتذللون فيؤمنون.

See similar narrations below:

Collected by Qurʾān
quran:7:94

And We sent to no city a prophet ˹who was denied˺ except that We seized its people with poverty and hardship that they might humble themselves ˹to Allah˺.  

And We did not send a prophet to any city but that, when they denied him, We seized, We punished, its people with misery, abject poverty, and hardship, illness, so that they might be humble, ˹so that they might be˺ self-effaced, and so believe.
القرآن:٧:٩٤

وَمَا أَرْسَلْنَا فِي قَرْيَةٍ مِنْ نَبِيٍّ إِلَّا أَخَذْنَا أَهْلَهَا بِالْبَأْسَاءِ وَالضَّرَّاءِ لَعَلَّهُمْ يَضَّرَّعُونَ  

{وما أرسلنا في قرية من نبي} فكذبوا {إلا أخذنا} عاقبنا {أهلها بالبأساء} شدة الفقر {والضرَّاء} المرض {لعلهم يضَّرَّعون} يتذللون فيؤمنون.