(39) باب النَّهْىِ عَنْ قَتْلِ النَّمْلِ،
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)?
Reference: Sahih Muslim 2241 c
In-book reference: Book 39, Hadith 202
USC-MSA web (English) reference(deprecated numbering scheme): Book 26, Hadith 5569