Anas bin Malik reported,

The Messenger of Allah ﷺ said, "When a servant is placed in his grave and his companions turn away from him, he hears the sound of their sandals. Two angels come to him, sit him up, and ask, 'What did you used to say about this man, Muhammad?'As for the believer, he says, 'I testify that he is the servant of Allah and His Messenger.' He is then told, 'Look at your seat in the Fire. Allah has replaced it for you with a seat in Paradise.' He sees both of them.As for the hypocrite and the disbeliever, he is asked, 'What did you used to say about this man?' He replies, 'I do not know. I used to say what the people said.' He is told, 'You did not know, nor did you follow those who knew.' Then he is struck with iron hammers a single blow, and he lets out a scream that is heard by everything near him except humans and jinn."

Azami 3864

Sahih

عن أنس بن مالك

أن رسول الله ﷺ قال: إن العبد إذا وضع في قبره وتولى عنه أصحابه- إنه يسمع قرع نعالهم- أتاه ملكان فيقعدانه فيقولان: ما كنت تقول في هذا الرجل لمحمد؟ فأما المؤمن فيقول: أشهد أنه عبد الله ورسوله فيقال له: انظر إلى مقعدك من النار، قد أبدلك الله به مقعدا من الجنة فيراهما جميعا، وأما المنافق والكافر فيقال له: ما كنت تقول في هذا الرجل؟ فيقول: لا أدري، كنت أقول ما يقول الناس فيقال: لا دريت ولا تليت، ويضرب بمطارق من حديد ضربة، فيصيح صيحة يسمعها من يليه غير الثقلين.

الأعظمي 3864صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Conditions of the deceased in the grave
Section
Believer and the disbeliever are both questioned, and the people of the graves are shown their seats twice every day
Numbering
Jami al-Kamil 3864 (2nd edition)
Azami 3864