Ayesha reported,

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

Bukhari 4435

Sahih

حدثني محمد بن بشار حدثنا غندر حدثنا شعبة عن سعد عن عروة

عن عائشة قالت

كنت أسمع أنه لا يموت نبي حتى يخير بين الدنيا والآخرة فسمعت النبي ﷺ يقول في مرضه الذي مات فيه وأخذته بحة يقول {مع الذين أنعم الله عليهم} الآية فظننت أنه خير

البخاري 4435صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Expeditions
Chapter
Illness of the Prophet ﷺ and his death
Numbering
Darussalam 4435
Bukhari 4435