“Looking in hope should not cut one off from fear, and vice versa, lest the former lead one into a Divine ruse, and the latter into despair. ‘Hope’ [rajā’] means that someone guilty of a shortcoming should have a good opinion of what Allah will do, and hope that He will erase his sin; likewise in the case of someone who has carried out an obedient act which he hopes will be accepted. A man who, without sorrowing or ceasing, plunges into disobedience hoping not to be taken to task, is deceived.
Admirable is the saying of Abu ‘Uthman al-Hiri: ‘It is a sign of felicity that you should obey God, and fear that your action will not be accepted; and it is a sign of damnation that you should rebel against Him and hope to be saved.’
It is said that fear is the preferable state for a person who is healthy, and that hope is preferable for someone who is sick. Some say that on one’s deathbed one should limit oneself to hope alone, since this entails absolute neediness of Allah, as in the hadith which runs: ‘Let none of you die without harbouring a good opinon of Allah.’ But others say that fear is never completely to be renounced, since no-one should be entirely convinced that he is safe. This is supported by the hadith which al-Tirmidhi narrates on the authority of Anas [r], that the Prophet ﷺ once came in upon a young man who was dying, and asked: ‘How are you’, to which the man replied: ‘My hope is in Allah, and my fear is for my sins.’ Allah’s Messenger ﷺ said: ‘These two things never conjoin in the heart of a slave of Allah in this condition without Allah giving him what he hopes for, and saving him from what he fears.’”
[Imam Ibn Ḥajar al-‘Asqalani, فتح الباري شرح صحيح البخاري (Fatḥ al-Bārī Sharḥ Ṣaḥīḥ al-Bukhārī), English Translation: Selections from the Fatḥ al-Bārī (Commentary on Ṣaḥīḥ al-Bukhārī), Muslim Academic Trust, Cambridge, 2000, p. 15]