Mishkat al-Masabih 1627
وَعَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: الْمَيِّتُ تَحْضُرُهُ الْمَلَائِكَةُ فَإِذَا كَانَ الرَّجُلُ صَالِحًا قَالُوا: اخْرُجِي أَيَّتُهَا النَّفْسُ الطَّيِّبَةُ كَانَتْ فِي الْجَسَدِ الطَّيِّبِ اخْرُجِي حَمِيدَةً وَأَبْشِرِي بِرَوْحٍ وَرَيْحَانٍ وَرَبٍّ غَيْرِ غَضْبَانَ فَلَا تَزَالُ يُقَالُ لَهَا ذَلِكَ حَتَّى تَخْرُجَ ثُمَّ يُعْرَجُ بِهَا إِلَى السَّمَاءِ فَيُفْتَحَ لَهَا فَيُقَالُ: مَنْ هَذَا؟ فَيَقُولُونَ: فُلَانٌ فَيُقَالُ: مَرْحَبًا بِالنَّفسِ الطّيبَة كَانَت فِي الْجَسَدِ الطَّيِّبِ ادْخُلِي حَمِيدَةً وَأَبْشِرِي بِرَوْحٍ وَرَيْحَانٍ وَرَبٍّ غَيْرِ غَضْبَانَ فَلَا تَزَالُ يُقَالُ لَهَا ذَلِكَ حَتَّى تَنْتَهِيَ إِلَى السَّمَاءِ الَّتِي فِيهَا اللَّهُ فَإِذَا كَانَ الرَّجُلُ السُّوءُ قَالَ: اخْرُجِي أَيَّتُهَا النَّفْسُ الْخَبِيثَةُ كَانَتْ فِي الْجَسَدِ الْخَبِيثِ اخْرُجِي ذَمِيمَةً وَأَبْشِرِي بِحَمِيمٍ وَغَسَّاقٍ وَآخَرَ مِنْ شَكْلِهِ أَزْوَاجٌ فَمَا تَزَالُ يُقَالُ لَهَا ذَلِكَ حَتَّى تَخْرُجَ ثُمَّ يُعْرَجُ بِهَا إِلَى السَّمَاءِ فَيُفْتَحُ لَهَا فَيُقَالُ: مَنْ هَذَا؟ فَيُقَالُ: فُلَانٌ فَيُقَالُ: لَا مَرْحَبًا بِالنَّفْسِ الْخَبِيثَةِ كَانَتْ فِي الْجَسَدِ الْخَبِيثِ ارْجِعِي ذَمِيمَةً فَإِنَّهَا لَا تفتح لَهُ أَبْوَابُ السَّمَاءِ فَتُرْسَلُ مِنَ السَّمَاءِ ثُمَّ تَصِيرُ إِلَى الْقَبْر . رَوَاهُ ابْن مَاجَه
From Abu Hurayrah, may Allah be pleased with him, who said: The Messenger of Allah ﷺ said: "The angels come to the dying person. If the man was righteous, they say: 'Come out, O good soul that was in a good body. Come out praised, and rejoice at rest, fragrance, and a Lord who is not angry.' This continues to be said to it until it comes out. Then it is taken up to the heaven, and [the gate] is opened for it, and it is said: 'Who is this?' They say: 'So-and-so.' It is said: 'Welcome to the good soul that was in a good body. Enter praised, and rejoice at rest, fragrance, and a Lord who is not angry.' This continues to be said to it until it reaches the heaven in which Allah is. And if the man was evil, he says: 'Come out, O wicked soul that was in a wicked body. Come out blameworthy, and receive the news of boiling water and pus, and other [punishments] of its kind in pairs.' This continues to be said to it until it comes out. Then it is taken up to the heaven, and [the gate] is opened for it, and it is said: 'Who is this?' It is said: 'So-and-so.' It is said: 'No welcome to the wicked soul that was in a wicked body. Go back blameworthy, for the gates of the heaven will not be opened for you.' So it is sent away from the heaven, and then it goes to the grave." Reported by Ibn Majah.