“ كُنْ فِي الدُّنْيَا كَأَنَّكَ غَرِيبٌ، أَوْ عَابِرُ سَبِيلٍ ”
`Abdullah bin `Umar said, “Allah’s Messenger (ﷺ) took hold of my shoulder and said, ‘Be in this world as if you were a stranger or a traveler.” The sub-narrator added: Ibn `Umar used to say, “If you survive till the evening, do not expect to be alive in the morning, and if you survive till the morning, do not expect to be alive in the evening, and take from your health for your sickness, and (take) from your life for your death.” (Sahih Al-Bukhaari)
Therefore, the believer’s life, long-term aspirations, goal in life, time, efforts, work and wealth should never be spent for the purposes of this worldly life alone. Instead, they should all be guided by his urgent desire to reach his true home, where he knows he belongs. They must all be guided by his want to please Allah and to be entered among Allah’s pious servants in the everlasting home of Paradise.
This is how a stranger behaves when he is in a foreign land. He is not happy with his day unless he feels that during it he has done something that will eventually lead him back to his home or that has helped him reach his final goal.
Furthermore, he does not try to compete with the inhabitants of that strange land because his interests and their interests are completely at odds. In addition, he is not trying to win their respect or praise, as in his heart he is merely seeking to return to his land. Al-Hasan al-Basri once said, “The believer is in the world like a stranger. He does not become unhappy from its humiliation, nor does he compete for its honor. He has one purpose and the people have another purpose.”
lbn Rajah points out that Allah originally placed Adam and Eve (Hawa) in Paradise. Then they were expelled from it. But they and their pious descendants were promised to be returned to that original home. Hence, that is the believer’s real home. In this world, he is a stranger, away from his home. Therefore, the believer is always yearning to return to that original home from whence he came.”
There are some other points that need to be explicitly stated concerning the stranger. A stranger desires to return to his land. However, he knows that he cannot return to his homeland if he starves to death where he is or if he makes extra efforts to survive where he is while sacrificing efforts to provide for his journey. It is true that the believer’s heart is not attached to this world, but at the same time, he must realize that he has to work in this world to be able to make it back to his homeland. That is, for the believer, this is the place of working- working with the goal of getting to where he belongs. This work involves true faith and performing the good deeds that are obligatory or recommended for him. These are, in fact, the provisions that will help him reach his homeland he so longs for.
However, some of that “work” involves this worldly life. Although he is a stranger, he is forced to have some involvement in this world. He is obliged to support himself and his family. He is obliged to order good and eradicate evil. He is obliged to be kind and good to others and so forth. Hence, he is a stranger but not in a negative sense; he contributes what is good to this world, yet he is not working for the sake of this world.
The second possibility that the Messenger of Allah (peace be upon him) mentioned for the believer is to be like a traveler along a path. This implies that the person is actually not residing anywhere but is always moving toward his final destination or goal. The end of his travels, of course, will be his death. Therefore, his only preoccupation is to gather the provisions that he needs to continue his journey and make his journey a successful one.
Hence, the believer is not interested in gathering too much of this world because such things make it more difficult for him to continue on his travels and to travel easily. Because this world is so alluring and attractive, it is easy for a Muslim to forget this. When he becomes attracted and attached to the things of this world, he forgets that he is on a journey. Instead of being ready to move closer to his destination when necessary, his store of worldly possessions and strong attachment to them render him unable to move on to the next leg of his trip. He is now no longer gathering provisions for his journey and his final destination but he is now accumulating things to help him stay where he is and become a full-fledged resident of this world. In other words, he has lost sight of the fact that he is supposed to be working and traveling toward a destination. He has become preoccupied with this worldly life, which should have remained only an insignificant stop along his journey and not something that takes up most of his time and efforts.
There is another important aspect that any traveler must be aware of: not getting lost or sidetracked along the way. The travels of a believer may be very long before he meets his Lord. Along the way, there are many things that may distract him. There are even enemies along the path. Satan, for example, is ever ready to take the believer away from the path. Therefore, the believer who is on this journey must always be seeking Allah’s guidance and His help to keep him moving in the right direction. Any straying from that path could be disastrous; his end may come suddenly and he may never have the chance to return to the straight path. Allah has awakened the believers to that sobering reality and He has guided them to say in every rakah of every prayer, “Guide us to the Straight Path.”
So, everyone is on a journey. It is a journey that ends with one’s meeting his Lord. When he meets Allah, he will be asked about his journey and how he behaved during it. If he realizes now that he is on such a journey, he should start preparing for the meeting toward which he is heading. And the only preparation is by increasing one’s faith, doing good deeds and working for that final destination rather than for any vain intermediate aim.
Taken from Commentary on the Forty Hadith of Al-Nawawi Vol 2.pdf Page 1268-1272