Surah Al-An'aam

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].

Tafsir 6:42

I sent messengers to many communities before you, O Messenger, but those communities denied their messengers and turned away from what they brought. I then tried them with poverty and sickness in order for them to submit and humble themselves before their Lord.