Anas bin Malik reported,

The Prophet ﷺ heard a voice from a grave and asked, "When did this person die?"They replied, "He died during the days of ignorance."He was pleased by that and said, "Were it not that you would cease burying your dead, I would have asked Allah to make you hear the punishment of the grave."

Azami 3843

Sahih

عن أنس

أن النبي ﷺ سمع صوتا من قبر فقال: متى مات هذا؟ قالوا: مات في الجاهلية، فسر بذلك وقال: لولا أن لا تدافنوا لدعوت الله أن يسمعكم عذاب القبر.

الأعظمي 3843صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Conditions of the deceased in the grave
Section
People of the Jahiliyyah being punished in their graves
Numbering
Jami al-Kamil 3843 (2nd edition)
Azami 3843