Ayesha reported,

The Messenger of Allah ﷺ used to say while he was in good health, "No prophet's soul is ever taken until he is shown his place in Paradise, 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 on the ceiling and said, "O Allah, the highest companionship."I said to myself, "Then he is not choosing us," and I realized that this was the very saying he used to tell us about.She said that these were the last words the Prophet ﷺ spoke, "O Allah, the highest companionship."

Bukhari 6509

Sahih

حدثني يحيى بن بكير حدثنا الليث عن عقيل عن ابن شهاب أخبرني سعيد بن المسيب وعروة بن الزبير في رجال من أهل العلم أن

عائشة زوج النبي ﷺ قالت

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

البخاري 6509صحيح
Contents
Reference
Commentary
Ayat
Collection
Sahih Bukhari
Book
Softening of hearts
Chapter
Whoever loves to meet Allah, Allah loves to meet him
Numbering
Darussalam 6509
Bukhari 6509