The Messenger of Allah ﷺ said, "None of you should wish for death or call upon it before it comes. When one of you dies, his deeds come to an end, and the believer's life only increases him in good."
قال رسول الله ﷺ: لا يتمنى أحدكم الموت ولا يدع به من قبل أن يأتيه، إنه إذا مات أحدكم انقطع عمله وإنه لا يزيد المؤمن عمره إلا خيرا.
Muslim narrated it in the chapter on remembrance and supplication (2682), from Muhammad bin Rafi, who said, Abdul-Razzaq narrated to us, Maamar informed us, from Hammam bin Munabbih, who said, this is what Abu Hurairah narrated to us from the Messenger of Allah ﷺ, and he mentioned several hadiths, among them this one.