«إذا أراد الله بعبد خيرا طهره قبل موته قالوا: وما طهور العبد؟ قال: عمل صالح يلهمه إياه حتى يقبضه عليه»
The Prophet (peace and blessings be upon him) said:
"When Allah Almighty intends good for a servant, He purifies him before he dies." The Companions said: "What is meant by the purification of the servant?" He (peace and blessings be upon him) said: "It is a righteous deed which Allah inspires in him (grants him the ability to do), until He takes his soul in that very state."
Hadith Referenceصحیح الجامع الصغیر / حرف الألف / 306