Ayesha reported,

Aishah reported that the Prophet ﷺ used to say while he was in good health, "No prophet's soul is taken until he is shown his place in Paradise, and then he is given the choice."When his final illness came upon him and his head was resting on my thigh, he lost consciousness for a while, then he came to. He fixed his gaze upward toward the ceiling of the room and said, "O Allah, the Highest Companion."I said to myself, "Then he is not choosing to remain with us." And I realized that this was the very saying he used to tell us about when he was healthy.She said, "His final words were, 'O Allah, the Highest Companion.'"

Azami 9317

Sahih

عن عائشة قالت

كان النبي ﷺ يقول- وهو صحيح-: إنه لم يقبض نبي حتى يرى مقعده من الجنة، ثم يخير فلما نزل به ورأسه على فخذي غشي عليه، ثم أفاق فأشخص بصره إلى سقف البيت، ثم قال: اللهم الرفيق الأعلى. فقلت: إذا لا يختارنا، وعرفت أنه الحديث الذي كان يحدثنا وهو صحيح. قالت: فكانت آخر كلمة تكلم بها: اللهم الرفيق الأعلى.

الأعظمي 9317صحيح
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 9317 (2nd edition)
Azami 9317