The Prophet of Allah (sal Allahu alaihi wa sallam) said: "When a deceased person is laid in his grave, he hears the sound of the footsteps of people as they go away. If he is a believer, the prayer will stand by his head, the fasting will be to his right, alms to his left, and all other good deeds of charity, kindness to relations, and good behavior will be by his feet." [Ahmad]
Then two fearsome, dread-inspiring angels, called Munkar and Nakeer, visit the soul to ask it about its religion, God, and prophet. The believing soul sits upright in its grave as Allah (subhana wa ta’ala) grants it the strength to answer the angels with full faith and certainty.
Munkar and Nakeer: “What is your religion?”
Believing soul: “Islam.”
Munkar and Nakeer: “Who is your Lord?”
Believing soul: “Allah.”
Munkar and Nakeer: “Who is your Prophet?” (or “What do you say about this man?”)
Believing soul: “Muhammad.”
Munkar and Nakeer: “How did you come to know these things?”
Believing soul: “I read the Book of Allah (i.e. the Quran) and I believed it.”
Then, when the soul passes the test, a voice from the heavens will call out: “My slave has spoken the truth, supply him with furnishings from Paradise, clothe him from Paradise, and open a gate for him to Paradise.” The believer’s grave is made roomy and spacious and filled with light. He is shown what would have been his abode in Hell - had he been a wicked sinner - before a portal is opened for him every morning and evening showing him his actual home in Paradise. Excited and full of joyful anticipation, the believer will keep asking: ‘When will the Hour (of Resurrection) come?! When will the Hour come?!’ until he is told to calm down. [Tirmidhi]