[Machine] The Messenger of Allah ﷺ prayed and took off his sandals. The people also took off their sandals. When he finished, he asked, "Why did you take off your sandals?" They replied, "O Messenger of Allah, we saw you take off your sandals, so we took off ours." He said, "Indeed, Jibril came to me and informed me that there was some impurity on them. So when one of you enters the masjid, let him flip his sandals and examine them for any impurity. If he finds any impurity, let him wipe them on the ground and then pray in them."
أَنَّ رَسُولَ اللَّهِ ﷺ صَلَّى فَخَلَعَ نَعْلَيْهِ فَخَلَعَ النَّاسُ نِعَالَهُمْ فَلَمَّا انْصَرَفَ قَالَ «لِمَ خَلَعْتُمْ نِعَالَكُمْ؟» قَالُوا يَا رَسُولَ اللَّهِ رَأَيْنَاكَ خَلَعْتَ فَخَلَعْنَا قَالَ «إِنَّ جِبْرِيلَ أَتَانِي فَأَخْبَرَنِي أَنَّ بِهِمَا خَبَثًا فَإِذَا جَاءَ أَحَدُكُمُ الْمَسْجِدَ فَلْيَقْلِبْ نَعْلَيْهِ فَلْيَنْظُرْ فِيهِمَا خَبَثٌ فَإِنْ وَجَدَ فِيهِمَا خَبَثًا فَلْيَمْسَحْهُمَا بِالْأَرْضِ ثُمَّ لِيُصَلِّ فِيهِمَا»