Abu Hurairah reported,

The Messenger of Allah ﷺ said, "None of you should wish for death. If he is a doer of good, he may increase his good deeds, and if he is a wrongdoer, he may yet seek to make amends."In another wording, "None of you should wish for death, nor pray for it before it comes to him. When one of you dies, his deeds come to an end, and the believer's life only increases him in goodness."

Azami 14653

Sahih

عن أبي هريرة

أن رسول الله ﷺ قال: لا يتمنى أحدكم الموت إما محسنا فلعله يزداد، وإما مسيئا فلعله يستعتب وفي لفظ: لا يتمنى أحدكم الموت، ولا يدع به من قبل أن يأتيه، إنه إذا مات أحدكم انقطع عمله، وإنه لا يزيد المؤمن عمره إلا خيرا.

الأعظمي 14653صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Superior moral conduct
Chapter
Etiquette of speech, words, and correspondence
Section
What is disliked of wishing
Numbering
Jami al-Kamil 14653 (2nd edition)
Azami 14653