Ayesha reported,

I used to hear that no prophet dies until he is given the choice between this world and the next. Then I heard the Prophet ﷺ during the illness in which he died, his voice grown hoarse, saying, "with those upon whom Allah has bestowed favor" [Nisa 4:69]. So I knew he had been given the choice.

Azami 3515

Sahih

عن عائشة قالت

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

الأعظمي 3515صحيح
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Funerals
Chapter
Dying person
Section
Among the distinctions of the prophets is that they are given the choice between remaining in this world and departing from it
Numbering
Jami al-Kamil 3515 (2nd edition)
Azami 3515