Sahih al-Bukhari 3019
Narration text is preserved in its supplied Arabic and English. Translated interfaces and reading guides do not add narration translations in other languages.
قَرَصَتْ نَمْلَةٌ نَبِيًّا مِنَ الأَنْبِيَاءِ، فَأَمَرَ بِقَرْيَةِ النَّمْلِ فَأُحْرِقَتْ، فَأَوْحَى اللَّهُ إِلَيْهِ أَنْ قَرَصَتْكَ نَمْلَةٌ أَحْرَقْتَ أُمَّةً مِنَ الأُمَمِ تُسَبِّحُ اللَّهِ."
Narrated Abu Hurairah (ra):
I heard Allah's Messenger (ﷺ) saying, "An ant bit a Prophet amongst the Prophets, and he ordered that the place of the ants be burnt. So, Allah inspired to him, 'It is because one ant bit you that you burnt a nation amongst the nations that glorify Allah?"
Full reference and source
Sahih al-Bukhari 3019 In-book : Book 56, Hadith 228 USC-MSA web (English) : Vol. 4, Book 52, Hadith 261 (deprecated)
View source on Sunnah.com (opens in a new tab)