Surah Al-An'am, ayah 42

6:42

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

Walaqad arsalnā ilā umamim min qablika fa akhadhnāhum bil-ba'sā'i wad-darrā'i la'allahum yatadarra'ūn

And We have already sent [messengers] to nations before you, [O Muḥammad]; then We seized them with poverty and hardship that perhaps they might humble themselves [to Us].