Hazrat Moulana Ashraf Ali Thanwi (rahmatullahi ‘alaih) once mentioned:

One should at no point become despondent of the mercy of Allah Ta’ala. Instead at all times one should hope for Allah Ta’ala’s special mercy. Allah Ta’ala deals with His servant in accordance to the expectation the servant has in Allah Ta’ala. Allah Ta’ala is all forgiving and all merciful. However, the condition and prerequisite to acquire His divine mercy is that one expresses his need (for the divine mercy) before Allah Ta’ala and one goes on striving in fulfilling the orders of Allah Ta’ala. (Malfoozaat Hakeemul Ummat 4/272)

Source: Ihyaauddeen.co.za