Jabir ibn 'Abdullah reported that he heard the Prophet, may Allah bless him and grant him peace, say three days before his death, "None of you should die without having a good opinion of Allah, the Mighty and Exalted."
Riyadh-as-Saliheen by Imam Al-Nawawi, volume 3, hadith number 441 - Sunni Hadith