Fear (khawf) and hope (raja) are the two wings by which the soul flies to God
Al-Ghazali insists the two must operate together, since fear alone collapses into despair and hope alone collapses into complacency, and he adjusts their balance by circumstance, letting hope outweigh fear specifically near death.
Book 33 of the Ihya pairs khawf and raja' as complementary rather than opposed states, and al-Ghazali is explicit that neither is healthy alone: fear unchecked by hope tips into despair about ever being forgiven, which the tradition treats as a serious spiritual failing in its own right since it denies God's mercy; hope unchecked by fear tips into presumption, a false security that stops striving because it assumes the outcome is already guaranteed. His image of the two wings makes the mechanics concrete: a bird flying on only one wing does not fly straighter or safer, it falls, so the two states have to operate together for the soul to actually make progress. He also notes the right proportion is not fixed, suggesting that near death hope should be allowed to outweigh fear, since dwelling on judgment at that point can push a dying person toward despair rather than toward God.
Ihya Ulum al-Din