Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
suyuti:1709a

When the soul of a believer would go out (of his body) it would be received bv two angels who would take it to the sky. Hammad (one of the narrators in the chain of transmitters) mentioned the swetness of its odour, (and further said) that the dwellers of the sky say: Here comes the pious soul from the side of the earth Let there be blessings of Allah upon the body in which it resides. And it is carried (by the angels) to its Lord, the Exalted and Glorious. He would say: Take it to its destined end. And if he is a nonbeliever and as it (the soul) leaves the body-Hammad made a mention of its foul smell and of its being cursed-the dwellers of the sky say: There comes a dirty soul from the side of the earth, and it would be said: Take it to its destined end. Abu Huraira reported that Messenger of Allah ﷺ put a thin cloth which was with him upon his nose while making a mention (of the foul smell) of the soul of a non-believer. (Using translation from Muslim 2872)   

السيوطي:١٧٠٩a

دا إِذا خرجتْ رُوحُ العبْد تلقَّاها مَلَكانِ يَصْعَدان بِها، فَذَكرَ مِنْ رِيح طيبها، ويَقولُ أهْلُ السَّمَاء: رُوح طَيبَة جاءتْ مِنْ قبَلِ الأرضِ، صَلّى اللهُ علَيك وَعلى جَسَدٍ كنتِ تَعْمُرِينه، فَينطَلَقُ بِه إلى رَبِّه ثُمَّ يَقولُ: انْطَلقوا به إلى آخر الأجلِ، وإِن الكَافِرَ إذا خرجتْ رُوحُه فَذُكرَ مِنْ نَتَنها ويقولُ أهْلُ السماء: خبيثةٌ جاءتْ مِنْ قِبَلِ الأرْضِ، فيقَالُ: انطَلِقُوا به إلى آخرِ الأجَلِ.  

[م] مسلم عن أبي هريرة

See similar narrations below:

Collected by Muslim
muslim:2872ʿUbaydullāh b. ʿUmar al-Qawārīrī > Ḥammād b. Zayd > Budayl > ʿAbdullāh b. Shaqīq > Abū Hurayrah

When the soul of a believer would go out (of his body) it would be received bv two angels who would take it to the sky. Hammad (one of the narrators in the chain of transmitters) mentioned the swetness of its odour, (and further said) that the dwellers of the sky say: Here comes the pious soul from the side of the earth Let there be blessings of Allah upon the body in which it resides. And it is carried (by the angels) to its Lord, the Exalted and Glorious. He would say: Take it to its destined end. And if he is a nonbeliever and as it (the soul) leaves the body-Hammad made a mention of its foul smell and of its being cursed-the dwellers of the sky say: There comes a dirty soul from the side of the earth, and it would be said: Take it to its destined end. Abu Huraira reported that Messenger of Allah ﷺ put a thin cloth which was with him upon his nose while making a mention (of the foul smell) of the soul of a non-believer.  

مسلم:٢٨٧٢حَدَّثَنِي عُبَيْدُ اللَّهِ بْنُ عُمَرَ الْقَوَارِيرِيُّ حَدَّثَنَا حَمَّادُ بْنُ زَيْدٍ حَدَّثَنَا بُدَيْلٌ عَنْ عَبْدِ اللَّهِ بْنِ شَقِيقٍ عَنْ أَبِي هُرَيْرَةَ قَالَ

إِذَا خَرَجَتْ رُوحُ الْمُؤْمِنِ تَلَقَّاهَا مَلَكَانِ يُصْعِدَانِهَا قَالَ حَمَّادٌ فَذَكَرَ مِنْ طِيبِ رِيحِهَا وَذَكَرَ الْمِسْكَ قَالَ وَيَقُولُ أَهْلُ السَّمَاءِ رُوحٌ طَيِّبَةٌ جَاءَتْ مِنْ قِبَلِ الأَرْضِ صَلَّى اللَّهُ عَلَيْكِ وَعَلَى جَسَدٍ كُنْتِ تَعْمُرِينَهُ فَيُنْطَلَقُ بِهِ إِلَى رَبِّهِ ﷻ ثُمَّ يَقُولُ انْطَلِقُوا بِهِ إِلَى آخِرِ الأَجَلِ قَالَ وَإِنَّ الْكَافِرَ إِذَا خَرَجَتْ رُوحُهُ قَالَ حَمَّادٌ وَذَكَرَ مِنْ نَتْنِهَا وَذَكَرَ لَعْنًا وَيَقُولُ أَهْلُ السَّمَاءِ رُوحٌ خَبِيثَةٌ جَاءَتْ مِنْ قِبَلِ الأَرْضِ قَالَ فَيُقَالُ انْطَلِقُوا بِهِ إِلَى آخِرِ الأَجَلِ قَالَ أَبُو هُرَيْرَةَ فَرَدَّ رَسُولُ اللَّهِ ﷺ رَيْطَةً كَانَتْ عَلَيْهِ عَلَى أَنْفِهِ هَكَذَا