A daughter of Messenger of Allah ﷺ sent him message while I and Sa'd were with him and I think Ubayy was also there: My son or daughter (the narrator is doubtful) is dying, so come to us. He sent her greeting, saying at the same time: Say! What Allah has been taken belongs to Him, what He has given (belongs to Him), and He has appointed time for everything. She then sent a message adjuring him (to come to her). So he came to her and the child who was on the point of death was placed in the hearts of those whom He wished. Allah shows compassion only to those of His servants who are compassionate. (Using translation from Abū Dāʾūd 3125)
أَرْسَلَتْ إِلَى رَسُولِ اللهِ ﷺ بَعْضُ بَنَاتِهِ أَنَّ صَبِيًّا لَهَا ابْنًا أَوْ ابْنَةً قَدِ احْتُضِرَتْ فَاشْهَدْنَا قَالَ فَأَرْسَلَ إِلَيْهَا يَقْرَأُ السَّلَامَ وَيَقُولُ إِنَّ لِلَّهِ مَا أَخَذَ وَمَا أَعْطَى وَكُلُّ شَيْءٍ عِنْدَهُ إِلَى أَجَلٍ مُسَمًّى فَلْتَصْبِرْ وَلْتَحْتَسِبْ فَأَرْسَلَتْ تُقْسِمُ عَلَيْهِ فَقَامَ وَقُمْنَا فَرُفِعَ الصَّبِيُّ إِلَى حِجْرِ أَوْ فِي حِجْرِ رَسُولِ اللهِ ﷺ وَنَفْسُهُ تَقَعْقَعُ وَفِي الْقَوْمِ سَعْدُ بْنُ عُبَادَةَ وَأُبَيٌّأَحْسِبُ فَفَاضَتْ عَيْنَا رَسُولِ اللهِ ﷺ فَقَالَ لَهُ سَعْدٌ مَا هَذَا يَا رَسُولَ اللهِ؟ قَالَ هَذِهِ رَحْمَةٌ يَضَعُهَا اللهُ فِي قُلُوبِ مَنْ شَاءَ مِنْ عِبَادِهِ وَإِنَّمَا يَرْحَمُ اللهُ مِنْ عِبَادِهِ الرُّحَمَاءَ