The Messenger of Allah ﷺ said, "None of you should wish for death. If he is a doer of good, he may increase in his good deeds, and if he is a wrongdoer, perhaps he may seek to make amends."
حدثنا عبد الرزاق أخبرنا معمر عن الزهري عن أبي عبيد مولى عبد الرحمن
قال رسول الله ﷺ لا يتمن أحدكم الموت إما محسن فيزداد إحسانا وإما مسيء فلعله أن يستعتب
Its isnad is sahih. It has already appeared as no. 7568, narrated by Ubaydullah bin Abdullah, from Abu Hurairah. We indicated there this narration, the narration of Abu Ubayd, freedman of Abdul-Rahman, and that Bukhari related it by this route, 13:189-190 of Fath al-Bari.