Sahih Muslim 2241 a
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
أَنَّ نَمْلَةً قَرَصَتْ نَبِيًّا مِنَ الأَنْبِيَاءِ فَأَمَرَ بِقَرْيَةِ النَّمْلِ فَأُحْرِقَتْ فَأَوْحَى اللَّهُ إِلَيْهِ أَفِي أَنْ قَرَصَتْكَ نَمْلَةٌ أَهْلَكْتَ أُمَّةً مِنَ الأُمَمِ تُسَبِّحُ "
Abu Huraira reported Allah's Messenger (ﷺ) as saying:
An ant had bitten a Prophet (one amongst the earlier Prophets) and he ordered that the colony of the ants should be burnt. And Allah revealed to him:" Because of an ant's bite you have burnt a community from amongst the communities which sings My glory."
Full reference and source
Sahih Muslim 2241 a In-book : Book 39, Hadith 200 USC-MSA web (English) : Book 26, Hadith 5567 (deprecated)
View source on Sunnah.com (opens in a new tab)