Al-Barā' ibn ‘Āzib (may Allah be pleased with him) reported: We went out with the Messenger of Allah (may Allah's peace and blessings be upon him) in a funeral procession of a man from the Ansār. We came to the grave and the niche had not yet been dug out. So the Messenger sat and we sat around him, as if we had birds upon our heads (very alert), and he had a stick in his hand with which he was striking the ground. He raised his head and said: "Seek refuge with Allah from the punishment of the grave," two or three times.
In another narration, this is added: “He hears the footfalls of their sandals when they go away, and it is said to him: ‘O you! Who is your Lord, what is your religion, and who is your prophet?’” Hanād said: “He said: ‘Then, two angels come to him and make him sit up. They will say to him: ‘Who is your Lord?’ He will say: ‘My Lord is Allah.’ They will say: ‘What is your religion?’ He will say: ‘My religion is Islam.’ They will say: ‘Who is this man who was sent amongst you?’ He will say: ‘He is the Messenger of Allah.’ They will say: ‘How did you come to know that?’ He will say: ‘I read the Book of Allah, believed in it, and attested to it.’” In another narration, Jarīr adds: "This is the statement of Allah, the Almighty: {Allah keeps firm those who believe.} [Sūrat Ibrahīm: 27]” “Then a caller will call from Heaven: ‘Indeed, my slave has spoken the truth, so spread a place for him in Paradise, open a door to Paradise for him, and dress him in the clothes of Paradise. Some of its fragrance and scent will come to him. A space as far as his eyes can see will be opened for him in it." Then, regarding the disbeliever, the Prophet (may Allah's peace and blessings be upon him) talked about his death and said: “And his soul will be restored to his body, and two angels will come and make him sit up. They will say: ‘Who is your Lord?’ He will say: ‘Ah, ah, I do not know!’ They will say: ‘What is your religion?’ He will say: ‘Ah, ah, I do not know!’ They will say: ‘Who is this man who was sent amongst you?’ He will say: ‘Ah, ah, I do not know!’ Then, a caller will call from the heaven: ‘He has lied, so spread a place for him in Hellfire, open a door to Hellfire for him, and dress him in the clothes of Hellfire.’ So some of its heat and scorching air will reach him, and his grave will be so compressed for him that his ribs will be crushed together.”
It is added in the narration by Jarīr: “Then a blind and mute angel will come to him, holding an iron sledge hammer, which, if a mountain was struck with it, it would turn it into dust. He will give him such a strike with it that it will be heard by whatever lies between the east and west, except mankind and the Jinn, and he will turn into dust. His spirit will then be restored to him."
Authentic hadith -
Narrated by Abu Daoud - Narrated by Ahmad