The Messenger of Allah ﷺ said, "For one of you to sit on a burning coal until it burns through his clothes is better for him than to sit on a grave."
حدثنا وكيع حدثنا سفيان عن سهيل بن أبي صالح عن أبيه
قال رسول الله ﷺ لأن يجلس أحدكم على جمرة حتى تحترق ثيابه خير له من أن يجلس على قبر
Its chain of transmission is sahih. The hadith was narrated by Muslim 2/667 no. 971, Abu Dawud 3/217 no. 3228, Nasai 4/95 no. 2044, and Ibn Majah 1/499 no. 1566, all in the chapter on funerals, on the prohibition of sitting on graves.