حَدَّثَنَا زُهَيْرٌ ، حَدَّثَنَا يَزِيدُ بْنُ هَارُونَ ، أَخْبَرَنَا حُمَيْدٌ الطَّوِيلُ ، عَنْ أَنَسِ بْنِ مَالِكٍ ، قَالَ رَسُولُ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ : لَا عَلَيْكُمْ أَلَّا تَعْجَبُوا بِأَحَدٍ حَتَّى تَنْظُرُوا بِمَ يُخْتَمُ لَهُ ، فَإِنَّ الْعَامِلَ يَعْمَلُ زَمَانًا مِنْ عُمُرِهِ - أَوْ بُرْهَةً مِنْ دَهْرِهِ - بِعَمَلٍ صَالِحٍ لَوْ مَاتَ عَلَيْهِ لَدَخَلَ الْجَنَّةَ ، ثُمَّ يَتَحَوَّلُ فَيَعْمَلُ بِعَمَلٍ سَيِّئٍ ، وَإِنَّ الْعَبْدَ لَيَعْمَلُ زَمَانًا مِنْ عُمُرِهِ بِعَمَلٍ سَيِّئٍ لَوْ مَاتَ عَلَيْهِ لَدَخَلَ النَّارَ ، ثُمَّ يَتَحَوَّلُ فَيَعْمَلُ بِعَمَلٍ صَالِحٍ ، وَإِذَا أَرَادَ اللهُ بِعَبْدٍ خَيْرًا اسْتَعْمَلَهُ ، قَالُوا : يَا رَسُولَ اللهِ ، وَكَيْفَ يَسْتَعْمِلُهُ ؟ قَالَ : يُوَفِّقُهُ لِعَمَلٍ صَالِحٍ ثُمَّ يَقْبِضُهُ عَلَيْهِ .
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: "It is incumbent on you not to be amazed by (the deeds of) anyone until you see upon what his end is sealed; for a doer does, for a long period of his life or for a span of time, such righteous deeds that if he were to die upon them he would enter Paradise; then he changes and begins doing evil deeds. And indeed, a servant does, for a period of his life, such evil deeds that if he were to die upon them he would enter Hell; then he changes and begins doing righteous deeds. And when Allah Almighty intends good for a servant, He puts him to work (in good deeds)." The Companions (may Allah be pleased with them) said: O Messenger of Allah (peace and blessings be upon him)! How does Allah put him to work? He (peace and blessings be upon him) said: "Allah Almighty grants him the ability to do a righteous deed before death, then takes his soul upon it."
Related hadith on this topic