The Prophet ﷺ said, "When death comes to a person, angels are present. If the person is righteous, they say, 'Come out, you good soul that dwelt in a good body.' They keep calling out to it until it comes forth. Then it is taken up to the heavens, and the gates are opened for it. It is asked, 'Who is this?' They reply, 'So-and-so.' It is said, 'Welcome, good soul.' This greeting continues to be given to it until it reaches the heaven in which Allah is."
عن النبي ﷺ قال: البيت تحضره الملائكة، فإذا كان الرجل صالحا، قالوا: أخرجي أيتها النفس الطيبة، كانت في الجسد الطيب… حتى تخرج، ثم يعرج بها إلى السماء، فيفتح لها، فيقال: من هذا؟ فيقولون: فلان، فيقال: مرحبا بالنفس الطيبة… فلا يزال يقال لها ذلك حتى ينتهي بها إلى السماء التي فيها الله عز وجل.
Ibn Majah (4262) narrated it from Abu Bakr bin Abu Shayba, who said, Shababa told us, from Ibn Abu Dhib, from Muhammad bin Amr bin Ata, from Saeed bin Yasar, from Abu Hurairah, and he related it as part of a long hadith that will come later in the chapter on funerals.Imam Ahmad (8769) narrated it through another route from Ibn Abu Dhib, with the same chain. Its isnad is sahih.The essence of the hadith was also transmitted by Ibn Hibban in his Sahih (3014), Hakim (1/352-353), and Nasai (1833), all of them through another route from Abu Hurairah, but none of them mentioned the phrase, "to the heaven in which Allah is" .