David wrote often about the wonderful works of God. When he was feeling depressed he wrote in Psalm 143:4-5. "Therefore is my spirit overwhelmed and faints within me [wrapped in gloom]; my heart within my bosom grows numb. I remember the days of old; I meditate on all Your doing; I ponder the work of Your hands." David's response to his feelings of depression and gloom was to choose to remember the good times of past days- pondering the doings of God and the works of His hands. In other words, he thought on something good, and it helped him overcome depression.
When the enemy comes against you with depression or discouragement, choose to remember the times God has blessed and delivered you in the past. Hope will rise in your heart and your troubles will seem small.