The Messenger of Allah ﷺ said, "For one of you to sit on a burning coal until it scorches his clothes and reaches his skin would be better for him than to step on a grave."
حدثنا عبد الصمد حدثنا حماد حدثنا سهيل عن أبيه
أن رسول الله ﷺ قال لأن يجلس أحدكم على جمرة حتى تحترق ثيابه وتخلص إليه خير له من أن يطأ على قبر
Its chain is sahih. Reported by Muslim in the Book of Funerals, chapter on the prohibition of plastering graves, 2/667, no. 971, Abu Dawud, no. 3228, in the Book of Funerals, chapter on the dislike of sitting on graves, Nasai in the Book of Funerals, chapter on the severity of sitting on graves, 2/95, no. 2044, and Ibn Majah, 1/499, no. 1566.