Optimism and Hope from Allah
Besides fear of allah, expecting good from Him is an act of sublime merit. Abu Hurairah has quoted a Prophetic saying, “Hoping for good is also an act of worship of Allah.” (Tirmidhi and Hakim)
In a hadith-e-qudsi our blessed Prophet has quoted the Divine words, “1 am what my bondsman thinks of me, and where he remembers Me, there 1 am with him.” (Bukhari and Muslim).
Many merits have been given in Q'uran and Hadith for having high hopes from Allah. This implies that one must try to live according to the Divine Commands and when he incuritably commits errors, he should expect Divine Mercy for it. But if one is entirely unmindful of Divine commands, does not care to reform himself, and is driven by worldly and carnal desire and yet expects Divine Pardon and Mercy, he has been castigated in hadith.
The right way is to try to reform oneself and to balance Allah's fear and good hopes from Him.
Anas has related that "Once our Prophet - may he be eternally blessed - went to a young man who was on his death bed and asked him 'How do you feel?' The young man said, 'I have much hope from Allah but 1 also fear for my sins'. The Holy Prophet said, The believer who has these two ideas simultaneously at such time, Allah fulfils his hopes and grants him security from fear." (Tirmidhi).