Ayesha reported,

Aisha said, "I used to hear that no prophet dies until he is given a choice between this world and the hereafter."She continued, "During the illness in which he passed away, I heard the Prophet ﷺ, his voice grown hoarse, reciting 'with those whom Allah has favored of the prophets, the truthful, the martyrs, and the righteous. And excellent are those as companions' [Nisa 4:69]. At that moment I knew he had been given the choice."

Azami 9316

Sahih

عن عائشة قالت

كنت أسمع أنه لن يموت نبي حتى يخير بين الدنيا والآخرة قالت: فسمعت النبي ﷺ في مرضه الذي مات فيه، وأخذته بحة يقول: {مع الذين أنعم الله عليهم من النبيين والصديقين والشهداء والصلحين وحسن أوليك رفيقا} [النساء: ٦٩]. قالت: فظننته خير حينئذ.

الأعظمي 9316صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Biography of the Prophet ﷺ
Chapter
Nearness of his death, his foretelling of it, his passing, and his burial
Section
Prophet ﷺ being given the choice between this world and the Hereafter
Numbering
Jami al-Kamil 9316 (2nd edition)
Azami 9316