Hadithcore
Mishkat al-Masabih, 1598

Abu Huraira reported God’s messenger as saying, "None of you must wish for death; neither one who does well, for perhaps he may do still more good, nor one who does ill, for perhaps he may seek to please God.” Bukhari transmitted it.

وَعَنْ أَبِي هُرَيْرَةَ رَضِيَ اللَّهُ عَنْهُ قَالَ: قَالَ رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ: «لَا يَتَمَنَّى أَحَدُكُمُ الْمَوْتَ إِمَّا مُحْسِنًا فَلَعَلَّهُ أَنْ يَزْدَادَ خَيْرًا وَإِمَّا مُسِيئًا فَلَعَلَّهُ أَنْ يستعتب» . رَوَاهُ البُخَارِيّ

References1 variant
In-Book Reference
Book 5, Hadith 75