Almighty Allah says, "No one despairs of solace from Allah except for those who are unbelievers." (Quran-12:87)
Anas said, "I heard the Messenger of Allah, may Allah bless him and grant him peace, say, 'Allah Almighty says, "O son of Adam! I will forgive you as long as you call on Me and have hope in Me, no matter what you do. Son of Adam, I do not care if your wrong actions reach to the clouds of heaven and then you ask Me for forgiveness, I will forgive you. Son of Adam, if you were to come with sins equivalent in weight to the whole earth and then meet Me having not associated anything with Me, I would come to you with the same amount of forgiveness.'" [Hadith-Tirmidhi]
Prophet Muhammad (sal Allahu alaihi wa sallam) said, "None of you should wish for death because of a calamity befalling him; but if he has to wish for death, he should say: 'O Allah! Keep me alive as long as life is better for me, and let me die if death is better for me.'"
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." [Haith-Muslim]
Abu Hurayra reported that the Messenger of Allah, may Allah bless him and grant him peace, said, "Allah, the Mighty and Exalted, said, 'I treat my slave according to his expectations of Me and I am with My slave when he remembers Anyone who approaches Me by a hand-span, I approach him by an arm-span. Anyone who approaches Me by an arm-span, I approach him by two armspans. If he comes to me walking, I come to him running." [Hadith]