‘Urwa b. az-Zubair said there were two men in Medina, one of whom made a niche when digging a grave, the other of whom did not. The people said that the one who came first should do as he was accustomed to do, and the one who made a niche came and made one for God’s messenger.
Hisham b. ‘Amir told that the Prophet said on the day of Uhud, “Dig graves, make them wide, deep and beautiful, bury two or three together in a single grave, and put first the one who knew most of the Qur’an.”
Ahmad, Tirmidhi, Abu Dawud and Nasa'i transmitted it, and Ibn Majah transmitted up to “beautiful”.
Abu Huraira reported God’s messenger as saying, “It is better that one of you should sit on live coals which burn his clothing and come in contact with his skin than that he should sit on a grave.”