The Messenger of Allah ﷺ took hold of part of my body and said, "Be in this world as though you were a stranger or a wayfarer, and count yourself among the people of the graves."Then Ibn Umar said to me, "When you reach the morning, do not expect to see the evening, and when you reach the evening, do not expect to see the morning. Take from your health before your sickness, and from your life before your death, for you do not know, Abdullah, what your name will be tomorrow."
حدثنا محمود بن غيلان حدثنا أبو أحمد حدثنا سفيان عن ليث عن مجاهد
أخذ رسول الله ﷺ ببعض جسدي فقال كن في الدنيا كأنك غريب أو عابر سبيل وعد نفسك في أهل القبور فقال لي ابن عمر إذا أصبحت فلا تحدث نفسك بالمساء وإذا أمسيت فلا تحدث نفسك بالصباح وخذ من صحتك قبل سقمك ومن حياتك قبل موتك فإنك لا تدري يا عبد الله ما اسمك غدا
[Sahih] Bukhari also reported it in the chapter on Riqaq, in the section on the saying of the Prophet ﷺ, "Be in this world as if you were a stranger or a traveler passing through," hadith no. 6416, from the hadith of Mujahid through the same chain. Layth is Ibn Abu Salim, and he was not the only one who narrated it.