Anas bin Malik reported,

The Prophet ﷺ entered one of the gardens of Banu Najjar and heard a sound coming from a grave. He asked about it, "When was this person buried?"They replied, "Messenger of Allah, this one was buried during the days of ignorance."This pleased him, and he 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."

Ahmad 12007

Sahih

حدثنا ابن أبي عدي عن حميد

عن أنس قال

دخل النبي ﷺ حائطا من حيطان بني النجار فسمع صوتا من قبر فسأل عنه متى دفن هذا فقالوا يا رسول الله دفن هذا في الجاهلية فأعجبه ذلك وقال لولا أن لا تدافنوا لدعوت الله عز وجل أن يسمعكم عذاب القبر

أحمد 12007صحيح
Contents
Reference
Commentary
Ayat
Collection
Musnad Ahmad
Book
Anas bin Malik
Numbering
Darussalam 12007
Ahmad 12007