Sure Al-An'aam

6:42

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

Wir haben ja schon zu Gemeinschaften vor dir (Gesandte) gesandt und über sie Not und Leid kommen lassen, auf daß sie unterwürfig flehen mögen.

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.