Qays bin Abu Hazim reported,

We visited Khabab when he had been cauterized seven times on his stomach. He said, "Were it not that the Messenger of Allah ﷺ forbade us from praying for death, I would have prayed for it."

Muslim 6817

Sahih

حدثنا أبو بكر بن أبي شيبة حدثنا عبد الله بن إدريس عن إسمعيل بن أبي خالد

عن قيس بن أبي حازم قال

دخلنا على خباب وقد اكتوى سبع كيات في بطنه فقال لو ما أن رسول الله ﷺ نهانا أن ندعو بالموت لدعوت به

مسلم 6817صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Muslim
Book
Remembrance, supplication, Tawba, and seeking forgiveness
Chapter
Dislike of wishing for death due to hardship that has befallen one
Numbering
Darussalam 6817
Muslim 6817