The Messenger of Allah ﷺ said, "When Allah intends good for a servant, He sweetens him."I asked, "Messenger of Allah, how does He sweeten him?"He replied, "He grants him success in performing a righteous deed before his death, then takes his soul while he is upon it."
قال رسول الله ﷺ: إذا أراد الله بعبد خيرا عسله قلت: يا رسول الله، وكيف يعسله؟ قال: يوفقه لعمل صالح قبل موته فيقبضه عليه.
Tabarani related it in Al-Awsat, Majma Bahrayn (3238), from Abdul-Rahman bin Amr Abu Zura, who said, Yahya bin Salih Wahazi narrated to us, who said, Yunus bin Uthman Muqri narrated to us, from Rashid bin Saad, from Ayesha, and he mentioned it. Haythami said in Al-Majma (7/215), "Its narrators are the narrators of Sahih, apart from Yunus bin Uthman, and he is trustworthy."I say, its chain of transmission is hasan on account of Yunus bin Uthman Muqri, about whom Ibn Hibban said in Al-Thiqat (7/649–650), "His hadith is to be considered when it is not related through Yahya bin Saeed Attar from him." And this is not related through Yahya bin Saeed Attar from him.On this subject there is also what was related from Abu Anba, who said, the Messenger of Allah said, "When Allah wishes good for a servant, He gives him honey." It was said, "And what is his honey?" He said, "Allah opens for him righteous deeds before his death, then takes him while he is upon them."Imam Ahmad related it (17784) from Surayj bin Numan, who said, Baqiyya narrated to us, from Muhammad bin Ziyad Alhani, who said, Abu Anba narrated to me, Surayj said, and he had companionship with the Prophet, he said, the Messenger of Allah said, and he mentioned the hadith.Abu Anba's status as a companion is disputed. Khalifa bin Khayat, Ibn Saad, Baghawi, and others counted him among the companions, while Abu Hatim Razi, who is an authority in the knowledge of narrators, denied that he had companionship with the Prophet, and placed him in the first generation of the successors of the people of Syria, just as the people of Syria denied that he had companionship with the Prophet.The chain also contains Baqiyya, who is Ibn Walid, much given to tadlis and taswiya, but Ibn Abu Asim related it in Al-Sunnah (400), and Qudai in Musnad Shihab (1389), through his route, and in it there is an explicit statement of narration.On this subject there is also a narration from Abu Umama, which Qudai related in Musnad Shihab (1388) and others related similarly, and in its chain of transmission is Ali bin Yazid Alhani, who is daif.