The Messenger of Allah ﷺ said, "For one of you to sit on a burning coal that scorches his clothes and reaches his skin is better for him than to sit on a grave."
قال رسول الله ﷺ: لأن يجلس أحدكم على جمرة فتحرق ثيابه، فتخلص إلى جلده، خير له من أن يجلس على قبر.
Muslim narrated it in the Book of Funerals (971) through several routes from Suhayl, from his father, from Abu Hurairah, who said, then he related it.As for what has been narrated from him in the wording, "Whoever sits on a grave defecating or urinating is like one who sits on a burning coal," this is daif. In its chain is Muhammad bin Abu Humayd, about whom Bukhari said, "His hadith is munkar (rejected)." He was also declared daif by Ibn Main, Abu Zura, Nasai, and others. Through his route it was narrated by Abu Dawud Tayalisi, Tahawi, Ahmad bin Mani, and others. See Matalib Aliyah (838).