Surah Ali 'Imran — Ayah 166 (3:166)
وَمَآ أَصَٰبَكُمۡ يَوۡمَ ٱلۡتَقَى ٱلۡجَمۡعَانِ فَبِإِذۡنِ ٱللَّهِ وَلِيَعۡلَمَ ٱلۡمُؤۡمِنِينَ ١٦٦
English translation (Saheeh International)
And what struck you on the day the two armies met [at Uḥud] was by permission of Allāh that He might make evident the [true] believers
Brief commentary
The death, wounds and defeat you suffered on the day of Uḥud, when your army and the army of the idolaters met, was by the permission and decree of Allah, with far-reaching wisdom behind it: to make it clear who truly had faith.