The Messenger of Allaah صلى الله عليه وسلم said,
"Be in the world as if you were a stranger or a traveler along a path." 
This hadith shows that a believer should have one of two attitudes toward this world. The first is that of a stranger in a strange land. He feels that he is in a place where he does not belong. This is not his home and he cannot feel entirely happy here. His heart can never be tied to this land. Instead, his heart and mind are preoccupied with getting back to his home. His time and his efforts are filled with that purpose. He is spending his time, money and capabilities to gather together what he needs to return to his home. His time is not spent or wasted on entrenching himself deeply in this environment to which he knows that he does not belong.
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." 
Thus, the believer will not compete against others for this world. Many times, this will be considered something very strange to others. However, he will not care if they consider him different or strange. In fact, he will definitely be a stranger to them because his concerns are so very different from theirs.
Imaam lbn Rajab رحمه الله points out that Allah سبحانه و تعالى originally placed Adam عليه السلام and Eve عليها السلام 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 word "or" here is not meant as a kind of indecision or doubt.  Instead, it implies a choice or variation, as in the phrase, "be this or that." However, according to at-Teebi رحمه الله, it is even better to be understood it as bal (بل). According to this interpretation, the translation would be, "Be in this world like a stranger; in fact, you should actually be like one traveling along a path." Hence, the Prophet صلى الله عليه وسلم first mentioned the stranger and then mentioned a higher or better level, the traveler. This is because a stranger can live and settle in the land where he is a stranger. However, the traveler has no intention but to move on. He does no deed except that which helps him reach his destination, living in fear that something may happen to him that will keep him from being able to reach his destination. Therefore, he is not actually residing in or becoming part of a place, as a stranger may do to some extent, but he is simply trying to move on. 
It is important to note that these are the only two options that the Prophet صلى الله عليه وسلم gave the believer with respect to this world: either be like a stranger or like one traveling along a path. If a believer's attitude toward this world does not resemble one of those two categories, it means that he is not treating this world in the manner that the Prophet صلى الله عليه وسلم has instructed.
The second possibility that the Messenger of Allah صلى الله عليه وسلم 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. In another hadith, it is narrated that the Prophet صلى الله عليه وسلم was lying on a hard mat. Sayyiduna Ibn Mas'ood رضي الله عنه began to wipe the effects of the mat from the Prophet' s body and suggested that he have something better to sleep on. The Prophet's صلى الله عليه وسلم reply was, "What do I have to do with this worldly life? I and this worldly life are but like a traveler who stopped for a little while under a tree to get some shade and then he moved on. " 
Imaam an-Nawawi رحمه الله stated that a person in this world is like a slave who was sent by his master to another land to fulfill some objective. His goal will be to fulfill that objective as quickly as possible and then return to his land and owner. As long as he is there, he will not bother with anything else along the way or with gathering as much as he can from that other land. 
Imaam Ibn Hajr رحمه الله stated, "In the same way that a traveler is not in need of more than what will get him to his destination, a believer does not need any more of this world than what will help him reach his [desired] destination [of Paradise]." 
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." Similarly, the Messenger of Allah صلى الله عليه وسلم, by his example of constantly making the following supplication, taught the believers to say, "O the One who Tums the Hearts, confirm my heart upon your religion." 
Many Muslims are not awake to the fact that they are actually on a journey, heading toward the meeting with their Lord. What is the solution for such Muslims? Al-Fudhail ibn lyaadh رحمه الله said to a man, "How old are you?" He said, "Sixty years old." Al-Fudhail رحمه الله then said, "For sixty years you have been traveling toward your Lord. It seems that you will soon reach your destination." The man said, "We belong to Allah and to Him we will return." Al-Fudhail رحمه الله said, "Do you know what that means? You are saying: I am a slave of Allah and to Him is the return. The one who knows that he is a slave of Allah and that he shall return to Him knows that he is, in fact, to be detained. The one who knows that he is to be detained knows that he is going to be asked. Therefore, he must prepare answers for that questioning." The man said, "What is the solution?" Al-Fudhail رحمه الله said, "It is simple." The man said, "What is it?" He replied, "Do good for the remainder of your life and you will be forgiven for what you did in the past. However, if you do evil in what remains of your life, you will be held responsible for what you did in the past and in the future." 
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. 
 Recorded by Imaam al-Bukhari رحمه الله.
 Jaami' al-'Uloom wal-Hikam, vol. 2 , p. 379
 Jaami' al-'Uloom wal-Hikam, vol. 2, p. 379. It should be noted that there is a difference of opinion among
the scholars as to whether the Paradise that Adam عليه السلام and Eve عليها السلام were in is the same Paradise that is
fromised to the believers in the Hereafter.
 Shaykh Ibn 'Uthaymeen رحمه الله mentions the possibility that the doubt is from one of the narrators, but that does not seem to be the likely case. Cf., Sharh Riyaadhus Saaliheen, vol. 6, p. 27.
 Al-Teebi رحمه الله was quoted in ibn Hajr رحمه الله, Fathul Baari (al-Tijaariyyah), vol. 13 , p. 9.
 Recorded by Imam Ahmad رحمه الله, at-Tirmidhi رحمه الله, ibn Maajah رحمه الله and others. According to Shaykh al-Albaani رحمه الله, it is sahih. See al-Albaani, Saheeh al-Jaami, vol. 2, p. 989. A similar story has been narrated concerning Sayyiduna 'Umar رضي الله عنه and the Prophet صلى الله عليه وسلم. That narration was recorded by Ahmad رحمه الله, al-Haakim رحمه الله and ibn Hibbaan رحمه الله.
 Imaam an-Nawawi رحمه الله was quoted in ibn Hajr رحمه الله, Fath (al-Tijaariyyah), vol. 13 , p. 10
 Ibn Hajr رحمه الله, Fath (al-Tijaariyyah), vol. 1 3 , pp. 9-10.
 Recorded by at-Tirmidhi رحمه الله and others. According to Shaykh al-Albaani رحمه الله, it is sahih. See al-Albaani, Saheeh al-Jaami, vol. 2, p. 1 323.
 Quoted in ibn Rajab رحمه الله, Jaami', vol. 2, p. 383 .
 Commentary on the 40 Hadeeth of Imaam an-Nawawi رحمه الله, vol. 2, pp. 1268-1272
See also: Attraction of Worldly Life - http://www.muftisays.com/forums/12-virtues/5132-attraction-of-worldly-life.html