It was narrated from Anas that the Prophet said:
When a person is put in his grave and his companions leave him, he hears the sound of their sandals. Two angels come to him, making him sit up, and say to him: 'What did you say about this man (Muhammad)?' As for the believer, he says: 'I bear witness that he says: 'I bear witness that he is the slave of Allah and His Messenger.' It is said to him: 'Look at your place in hell; Allah has replaced it for you with a place better than it.''' The Messenger of Allah said: Then he sees them both. As for the disbeliever or the hypocrite, it is said to him: 'What did you say about this man?' He says: 'I do not know; I used to say what the people said.' It is said to him: 'You did not understand and you did not follow those who had understanding.' Then he is dealt a blow between his ears and the man utters a scream which everything near him hears, except for the two races.'''