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."
أخبرنا محمد بن عبد الله بن المبارك عن وكيع عن سفيان عن سهيل عن أبيه
قال رسول الله ﷺ لأن يجلس أحدكم على جمرة حتى تحرق ثيابه خير له من أن يجلس على قبر
Muslim reported it in the chapter on the prohibition of sitting on a grave or praying towards it, in the Book of Funerals, hadith no. 971, from the hadith of Sufyan Thawri, and it is found in Al-Kubra, hadith no. 2171.