From Volume I of The Philokalia:
Our fifth struggle is against the demon of dejection, who obscures the soul's capacity for spiritual contemplation and keeps it from all good works. When this malicious demon seizes our soul and darkens it completely, he prevents us from praying gladly, from reading Holy Scripture with profit and perseverance, and from being gentle and compassionate towards our brethren. He instills a hatred of every kind of work and even of the monastic profession itself. Undermining all the soul's salutary resolutions, weakening its persistence and constancy, he leaves it senseless and paralyzed, tied and bound by its despairing thoughts.
If our purpose is to fight the spiritual fight and to defeat, with God's help, the demons of malice, we should take every care to guard our heart from the demon of dejection. Just as a moth devours clothing and a worm devours wood, so dejection devours a man's soul. It persuades him to shun every helpful encounter and stops him accepting advice from his true friends or giving them a courteous and peaceful reply. Seizing the entire soul. it fills it with bitterness and listlessness. Then it suggests to the soul that we should go away from other people, since they are the cause of its agitation. It does not allow the soul to understand that its sickness does not come from without, but lies hidden within, only manifesting itself when temptations attack the soul because of our ascetic efforts.
A man can be harmed by another only through the causes of the passions which lie within himself. It is for this reason that God, the Creator of all and the Doctor of men's souls, who alone has accurate knowledge of the soul's wounds, does not tell us to forsake the company of men; He tells us to root out the causes of evil within us and to recognize that the soul's health is achieved not by a man's separating himself from his fellows, but by his living the ascetic life in the company of holy men. When we abandon our brothers for some apparently good reason, we do not eradicate the motives for dejection but merely exchange them, since the sickness which lies hidden within us will show itself again in other circumstances.
Thus it is clear that our whole fight is against the passions within. Once these have been extirpated from our hearts by the grace and help of God, we will readily be able to live not simply with other men, but even with wild beasts. Job confirms this when he says: "And the beasts of the field shall be at peace with you" (Job 5:23). But first we must struggle with the demon of dejection who casts the soul into despair. We must drive him from our heart. It was this demon that he did not allow Cain to repent after he had killed his brother, or Judas after he had betrayed his Master. The only form of dejection we should cultivate is the sorrow which goes with repentance for sin and is accompanied by hope in God. It was of this form of dejection that the Apostle said: "Godly sorrow produces a saving repentance which is not to be repented of" (2 Cor. 7:10). This "godly sorrow" nourishes the soul through the hope engendered by repentance, and it is mingled with joy. That is why it makes us obedient and eager for every good work: accessible, humble, gentle, forbearing, and patient in enduring all the suffering or tribulation God may send us. Possession of these qualities shows that a man enjoys the fruits of the Holy Spirit: love, joy, peace, long-suffering, goodness, faith, self-control (cf. Gal. 5:22). But from the other kind of dejection we come to know the fruits of the evil spirit: listlessness, impatience, anger, hatred, contentiousness, despair, sluggishness in praying. So we should shun this second form of dejection as we would unchastity, avarice, anger and the rest of the passions. It can be healed by prayer, hope in God, meditation on Holy Scripture, and by living with godly people.