The Messenger of Allah ﷺ said that an ant bit one of the prophets, so he ordered the colony of ants to be burned. Allah then revealed to him, "Because a single ant bit you, you have destroyed an entire nation that glorifies Me."
أخبرنا وهب بن بيان قال حدثنا ابن وهب قال أخبرني يونس عن ابن شهاب عن سعيد وأبي سلمة
عن رسول الله ﷺ أن نملة قرصت نبيا من الأنبياء فأمر بقرية النمل فأحرقت فأوحى الله عز وجل إليه أن قد قرصتك نملة أهلكت أمة من الأمم تسبح
Muslim narrated it, in the Book of Greetings, the chapter on the prohibition of killing ants, hadith no. 2241, from the hadith of Ibn Wahb, and Bukhari, in the Book of Jihad, chapter 153, hadith no. 3019, from the hadith of Yunus bin Yazid, with the same wording, and it is also found in Al-Kubra, hadith no. 4870.