It is narrated from Sayyiduna Anas bin Malik (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "You should not be hasty in praising anyone until you see how his end turns out. For sometimes a person who does deeds does righteous deeds for a long part of his life, or for a period of his time, such that if he died in that state he would enter Paradise; then he changes and begins doing evil deeds. And indeed a person spends a period of his life in evil deeds, such that if he died in that state he would enter Hell; then he changes and begins doing righteous deeds. And remember that when Allah Almighty intends good for a servant, He employs him (in good work) before his death." The Companions said: O Messenger of Allah! How does Allah employ him?! He (peace and blessings be upon him) said: "Allah Almighty grants him the ability to do a righteous deed before his death, and then takes his soul upon it." Imam Musaddad recorded this hadith as mawquf (the Companion's own words) with a sahih chain, while Abu Bakr bin Abi Shaybah, Abd bin Humayd, Imam Ahmad bin Hanbal, Abu Ya'la and al-Hakim recorded it as marfu' (the Prophet's words), and al-Hakim declared it sahih; their wordings are close to one another. Imam al-Tirmidhi recorded it in abridged form.
It is narrated from Sayyiduna Amr bin al-Hamiq al-Khuza'i (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "When Allah Almighty intends good for a servant, He makes him 'asalahu' (sweet like honey)." It was asked: What is meant by making him 'asalahu'? He (peace and blessings be upon him) said: "Allah, Glorified and Exalted, grants him the ability to do a righteous deed before his death, until those around him are pleased with him." Imam Abu Bakr bin Abi Shaybah, Abd bin Humayd, Ahmad bin Hanbal, Ibn Hibban in his Sahih, al-Hakim and al-Bayhaqi recorded this hadith. This hadith also has a supporting narration (shahid) from the narration of Sayyiduna Abu Hurayrah (may Allah be pleased with him), which will come shortly in the section on 'deeds are judged by their endings'.