The last words of the Messenger of Allah ﷺ were, "The prayer, the prayer. Fear Allah regarding those whom your right hands possess."
حدثنا زهير بن حرب وعثمان بن أبي شيبة قالا حدثنا محمد بن الفضيل عن مغيرة عن أم موسى
كان آخر كلام رسول الله ﷺ الصلاة الصلاة اتقوا الله فيما ملكت أيمانكم
Its isnad is daif. Ibn Majah narrated it in the Wills, chapter "Did the Messenger of Allah ﷺ leave a will?", hadith 2698, from Muhammad bin Fudayl through this route, and its chain is daif. The hadith has daif corroborating narrations found in Ahmad, 3/117, and elsewhere.