Sahih Muslim 2241 c
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 so many ahadith and one of them was this that Allah' Messenger (ﷺ) said:
When an Apostle from amongst the Apostles of Allah came to sit under a tree an ant bit him. He commanded his luggage to be removed from under the tree and he commanded it to be burnt in the fire and Allah revealed to him:" Why one ant (which had bitten you) was not killed (and why did you burn the others)?
Full reference and source
Sahih Muslim 2241 c In-book : Book 39, Hadith 202 USC-MSA web (English) : Book 26, Hadith 5569 (deprecated)
View source on Sunnah.com (opens in a new tab)