Hadithcore
Mishkat al-Masabih, 1614

Abu Umama said:

We sat attentive to God’s messenger who gave us an exhortation and softened our hearts. Then Sa'd b. Abu Waqqas wept copiously and said, “Would that I were dead! ” God’s messenger said, “Do you wish for death in my presence, Sa'd?’’ repeating it three times. He then said, “Sa'd, if you have been created for paradise, it will be better for you if your life is prolonged and your deeds are good.” Ahmad transmitted it.

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

References1 variant
In-Book Reference
Book 5, Hadith 90