Hadith 4114

It was narrated that Ibn ‘Umar said: “The Messenger of Allah (saw) took hold of some part of my body and said: ‘O ‘Abdullah, be in this world like a stranger, or one who is passing through, and consider yourself as one of the people of the graves.’”

حَدَّثَنَا يَحْيَى بْنُ حَبِيبِ بْنِ عَرَبِيٍّ، حَدَّثَنَا حَمَّادُ بْنُ زَيْدٍ، عَنْ لَيْثٍ، عَنْ مُجَاهِدٍ، عَنِ ابْنِ عُمَرَ، قَالَ أَخَذَ رَسُولُ اللَّهِ ـ صلى الله عليه وسلم ـ بِبَعْضِ جَسَدِي فَقَالَ ‏"‏ يَا عَبْدَ اللَّهِ كُنْ فِي الدُّنْيَا كَأَنَّكَ غَرِيبٌ أَوْ كَأَنَّكَ عَابِرُ سَبِيلٍ وَعُدَّ نَفْسَكَ مِنْ أَهْلِ الْقُبُورِ ‏"‏ ‏.‏

Reference: 1342520
In-book reference: Book 37, Hadith 4114
Hadith 4114 - Tribulations - Sunan Ibn Majah - Sunnah.com