Anas bn Maalik (radhiyalLaahu 'anh) narrated: The Messenger
of Allaah (sallal Laahu 'alayhi wassallam) said:
"When Allaah wills good for a slave, He employs
him."
The companions inquired: how does He employ him?'
He (sallal Laahu 'alayhi wassallam) said:
"He allows him righteous deeds just before his
death."
- Haakim, Saheeh
Targheeb #3357.