Ayesha reported,

I heard the Messenger of Allah ﷺ say, "No prophet falls ill except that he is given the choice between this world and the next."When he was in the illness during which he passed away, his voice grew hoarse, and I heard him say, "With those whom Allah has favored among the prophets, the truthful, the martyrs, and the righteous." So I knew that he had been given the choice.

Ibn Majah 1620

Sahih

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

عن عائشة قالت

سمعت رسول الله ﷺ يقول ما من نبي يمرض إلا خير بين الدنيا والآخرة قالت فلما كان مرضه الذي قبض فيه أخذته بحة فسمعته يقول مع الذين أنعم الله عليهم من النبيين والصديقين والشهداء والصالحين فعلمت أنه خير

ابن ماجه 1620صحيح
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Funerals
Chapter
Illness of the Messenger of Allah ﷺ
Numbering
Darussalam 1620
Ibn Majah 1620