Ibn Umar (radhiallahu 'anhum) said: Allâh's Messenger (sallallahu 'alaihi wa sallam) took me by my shoulder and said: "Be in this life as if you were a stranger or a traveller on a path." [Reported by al-Bukhârî]
Ibn 'Umar used to say,
"If you reach the evening then do not expect to reach the morning, and if you reach the morning then do not expect to reach the evening. Take from your health before your sickness, and from your life before your death." [Reported by al-Bukhârî]
This hadîth is the foundation for limiting one's hope in this life. A believer must not take this life as a homeland or permanent residence, his heart being tranquil and resting assured within it. Rather, he must be in it as if he were on a journey, preparing himself to depart. The advice of the Prophets and their followers confirms this.
Allâh said, narrating about a believer at the time of Fir'awn that he said:
"O my people! Truly, this life of the world is nothing but a (quick passing) enjoyment, and verily, the hereafter that is the home that will remain forever." [Ghafir : 39]
Alî ibn Abi Tâlib (may Allaah be pleased with him) used to say,
"Certainly this life has begun travelling away, and the hereafter has begun travelling forward, and each has its children. So be from the children of the hereafter, and don't be from the children of this life. For indeed today there is action with no account, and tomorrow there will be account with no action."
Umar ibn Abdul Azîz said in his khutbah,
"This life is not your permanent abode. Allâh has prescribed for it to come to an end and He has prescribed for its people to depart from it. How often has a thriving population been ruined for something insignificant, and how often has a joyful resident been made to depart for something insignificant. So prepare well, may Allâh have mercy on you, for the journey with the best of what you have of preparations, and take provisions, for the best of provisions is Taqwâ."
So if this life is not a permanent residence nor homeland for the believer, then the situation of the believer in it must be either one of two conditions: Either as if he were a stranger residing in a strange land with his main concern being to take provisions for his return to his real homeland; or as if he were a traveller, in no way residing in it, rather his every night and day is spent going towards his land of residence.
Due to this, the Prophet (sallallahu 'alaihi wa sallam) advised Ibn Umar to be in this life in one of these two conditions:
The first condition: That the believer abandons himself as if he were a stranger in this life, appearing to be a resident, yet really in a strange land. So his heart is not attached to this strange land. Rather, his heart is attached to his homeland that he is returning to. He is only staying in this life to fulfill his objective - preparing for the return to his homeland.
Al-Fudhayl ibn Iyyâdh said,
"A believer in this life is worried and sad. His worry is the objective of preparing himself. So whoever's condition in this life is such, then he has no concern other than taking provisions from what will benefit him during the return to his homeland. So he does not compete with the people of the land, among whom he is merely a stranger, in what they consider honorable. And he does not become worried if he seems insignificant among them."
Al-Hasan (al-Basrî) said,
"The believer is like a stranger. He does not become worried due to being insignificant in it (this life), and he does not compete for honor in it. His condition is one and the people are in another condition. When Allâh created Adam ('alayhis salâm), He made him and his wife reside in Paradise. Then he was taken out of it, yet was promised to return to it, (both) he and the righteous ones among his offspring. So the believer is always longing for his first homeland..." 
The second condition: That the believer lowers himself in this life as if he were a traveller, in no way residing in it. He is only moving along in one of the points of his journey until he finishes his journey to its end, which is death. Whoever's condition in this life is such, and then his main concern is obtaining the provision for the journey. He is not concerned with an abundance of the enjoyment of this life. For this reason, the Prophet (sallallahu 'alaihi wa sallam) advised a group of his Companions for their main concern in this life to be like the provision of a traveller.
One of the Salaf wrote to one of his brothers:
"Oh my brother, it appears to you as if you are a resident. However, you are really only persistently travelling, and you are moving rapidly. Death is heading towards you, and this life is passing behind you. What has passed of your life will not return to you (to rectify it) on the Day of Taghâbun (The Day of Resurrection)."
Al-Fudhayl ibn Iyyâdh said to a man, "How many (years) have passed you?" He replied, "Sixty years." He said,
"Therefore, for sixty years you have been going to your Lord and you are about to reach (Him)."
The man then said, "To Allâh we belong and to Him we are returning!" So al-Fudhayl asked,
"Do you know the meaning of that (statement)? You are saying, 'I belong to Allâh as a servant and I am going to return to Him.' So whoever knows that he belongs to Allâh as a servant and that he will return to him, then he should know that he will be stopped. And whoever knows that he will be stopped, then he should know that he will be questioned. And whoever knows that he will be questioned, then let him prepare an answer for the question."
The man asked, "So what should I do?" He said, "It is easy." The man again asked, "What is it?" al-Fudhayl said,
"Do good in what remains, then what has passed shall be forgiven. Yet, if you do evil in what remains, then you will be taken to account for what has passed as well as for what remains."
Some of the wise people said,
"Whoever made the days and nights his riding animal, then they will take him (to his destination) even if he doesn't move."
Al-Awzâ'î wrote to one of his brothers,
"As to what follows: You have been encompassed from every side. Know that you are moving forward with each day and night. So beware of Allâh and of the standing infront of him. And your final promise will be with Him.Was-Salâm."
As for the advice of Ibn Umar, then it is based upon this Hadîth that he himself has narrated. It (his advice) includes an end to prolonged hope. And that if a person happens to reach the evening, then he should not wait for, or expect to reach the morning. And if he happens to reach the morning, then he should not wait for, or expect to reach the evening. Rather, he should assume that his end will reach him before that. With this same meaning, more than one of the scholars have explained the concept of having Zuhd (asceticism and piety) in this life.
Al-Marwathî said: It was said to Abû Abdullâh - meaning Ahmad (ibn Hanbal), "What is the meaning of having Zuhd in this life?" He said,
"Not prolonging hope too much - He who says when he wakes up, 'I will not reach the evening.'"
He said, "And Sufyân (ath-Thawrî) said likewise." It was then said to Abû Abdullâh,
"With what do we seek help in not prolonging our hope?" He replied,
"We don't know. It is only by Tawfîq (Success exclusively granted by Allâh)."
As for his (Ibn Umar's) statement: "Take from your health before your sickness, and from your life before your death." Meaning: Take advantage of being able to do righteous deeds with what remains of your health before sickness prevents you from them, and from your life before death prevents you from them.
And in another narration: "...For surely, oh servant of Allâh, you don't even know what your own name will be tomorrow." Meaning: Perhaps tomorrow you will be among the dead, not the living.
The meaning of this advice has been reported from the Prophet (sallallahu 'alaihi wa sallam) from a different perspective. In Sahîh al-Bukhârî, it is reported that Ibn Abbâs narrated that the Prophet (sallallahu 'alaihi wa sallam) said: "There are two blessing which many people are deprived of: health and free time." 
And in the Mustadrak of al-Hâkim, it is reported that Ibn Abbâs narrated that the Messenger of Allâh (Sallallahu 'Alaihi Wa Sallam) said to a man while advising him: "Take advantage of five things before five other things: from your youth before your old age, your health before your sickness, your richness before your poverty, your free time before you become occupied, and from your life before your death." 
The meaning of this is that all of these things hinder the performance of deeds. Some of them personally preoccupy the person such as his poverty, richness, sickness, his old age, or his death. Others are more general such as the establishment of the Last Hour, the appearance of the Dajjâl, and other disturbing trials as is mentioned in the Hadîth:
"Take the initiative to do deeds, before trials come like a piece of a dark night (unexpectedly)." 
After the appearance of some of these more general events, no deeds will be of any benefit as Allâh said: "The day that some of the Signs of your Lord do come, no good will it do to a person to believe then, if he believed not before, nor earned good (by performing deeds of righteousness) through his Faith." [Al-An'am : 158]
In the two Sahîhs (al-Bukhârî and Muslim), Abû Hurayrah narrated that the Prophet (sallallahu 'alaihi wa sallam) said: "The Hour will not be established until the sun rises from the west. So when it rises and the people see it, they will all believe. That is when the faith of a person will not benefit him if he did not previously believe or if he did not earn good by his faith." 
And in Sahîh Muslim, the Prophet (sallallahu 'alaihi wa sallam) said: "There are three events that if they occur, the faith of a person will not benefit him if he did not previously believe or if he did not earn good by his faith: the rising of the sun from the west, the Dajjâl, and the Beast from the earth." 
Also in Sahîh Muslim, the Prophet (sallallahu 'alaihi wa sallam) said: "Whoever repents before the sun rises from the west, Allâh will accept his repentance." 
Abû Mûsâ narrated that the Prophet (sallallahu 'alaihi wa sallam) said: "Allâh extends his hand during the night to accept the repentance of the sinner of the day, and He extends his hand during the day to accept the repentance of the sinner of the night, until the sun rises from the west." 
So the believer must take the initiative in performing righteous deeds before he is overtaken by the decree and prevented from doing them either by sickness or death, or by some of these signs reaching him after which no deed will be accepted.
Abû Hâzim said,
"The merchandise of the hereafter is in little demand. It is about to be spent with no one obtaining it except a few, not many."
So when a person is prevented from deeds, nothing remains for him except regret and sorrow. He will wish to return to the previous situation in which he was be able to perform deeds, yet wishing at that time will not benefit him in anything.
Allâh, the Most High says: "And turn in repentance and in obedience with true Faith (Islâmic Monotheism) to your Lord and submit to Him, (in Islâm), before the torment comes upon you, then you will not be helped. And follow the best of that which is sent down to you from your Lord (i.e. this Qur'ân, do what it orders you to do and keep away from what it forbids), before the torment comes on you suddenly while you perceive not! Lest a person should say: 'Alas, my grief that I was undutiful to Allâh (i.e. I have not done what Allâh has ordered me to do), and I was indeed among those who mocked [at the truth!' i.e. Lâ ilâha ill-Allâh (none has the right to be worshipped but Allah), the Qur'ân, and Muhammad and at the faithful believers, etc.] Or (lest) he should say: 'If only Allah had guided me, I should indeed have been among the Muttaqûn (pious and righteous people)'. Or (lest) he should say when he sees the torment: 'If only I had another chance (to return to the world) then I should indeed be among the Muhsinûn (good-doers).'" [Az-Zumar : 54-58]
And He says: "Until, when death comes to one of them (those who join partners with Allâh), he says: 'My Lord! Send me back, so that I may do good in that which I have left behind!' No! It is but a word that he speaks, and behind them is Barzakh (a barrier) until the Day when they will be resurrected." [Al-Mu'minûn : 99-100]
And He, the Mighty and Majestic, says:
"And spend (in charity) of that with which We have provided you, before death comes to one of you and he says: 'My Lord! If only You would give me respite for a little while (i.e. return to the worldly life), then I should give Sadaqah (i.e. Zakât) of my wealth, and be among the righteous.' [i.e. perform Hajj (pilgrimage to Makkah)] And Allâh grants respite to none when his appointed time (death) comes. And Allâh is All-Aware of what you do." [Al-Munafiqûn : 99-100]
So since the matter is like this, it is incumbent upon the believer to take advantage of what remains from his life. In explanation of this, it is said:
"The remainder of the believer's life is priceless."
Sa'îd ibn Jubayr said,
"Each day the believer lives is a treasure."
2. Translators Note: A large amount of Arabic poetry, due to the difficulty in translating it adequately, has been omitted.
3. Reported by al-Bukhârî, vol. 11, pg. 229 (in Fath al-Bârî).
4. Reported by al-Hâkim, vol. 4, no. 306. He declared it to be Sahîh according to the condition of the two Shaykhs (al-Bukhârî and Muslim) and ath-Thahabî agreed with him as well as our Shaykh (al-Albânî) in the checking of the Hadîths of "Iqtidâ al-I'lm al-A'mal," no. 170.
5. Reported by Muslim, no. 118.
6. Reported by al-Bukhârî, vol. 8, pg. 296-297 (in Fath al-Bârî) and Muslim, no. 157.
7. Reported by Muslim, no. 158.
8. Reported by Muslim, no. 2703.
9. Reported by Muslim, no. 2759.