(32) باب قَوْلِ النَّبِيِّ صلى الله عليه وسلم: «يُعَذَّبُ الْمَيِّتُ بِبَعْضِ بُكَاءِ أَهْلِهِ عَلَيْهِ» إِذَا كَانَ النَّوْحُ مِنْ سُنَّتِهِ
Narrated Anas bin Malik:
We were (in the funeral procession) of one of the daughters of the Prophet (ﷺ) and he was sitting by the side of the grave. I saw his eyes shedding tears. He said, "Is there anyone among you who did not have sexual relations with his wife last night?" Abu Talha replied in the affirmative. And so the Prophet told him to get down in the grave. And so he got down in her grave.
Reference: Sahih al-Bukhari 1285
In-book reference: Book 23, Hadith 46
USC-MSA web (English) reference(deprecated numbering scheme): Vol. 2, Book 23, Hadith 374