Depression is a complex problem, but one thought that can really kick it into overdrive is a general sense that "life is terrible and there's nothing that can be done to make it better." In other words, feeling pessimistic that anything can be done.
When someone is coming off of years of struggle, obstacles, and pain, that's not a crazy thought. The problem is there are an infinite number of things that can be done. But, in the moment those possibilities aren't yet known. This is when the mind can get so stuck on the "there's nothing" thought that it doesn't tap into problem-solving mode.
One of the greatest things a person can do to feel liberated from the hopelessness of "nothing" is be able to internalize a sense of "something." The catch is you probably don't know what that something is. More precisely, you don't know what it is yet. If you can develop a sense of possibility, a faith in the infinite unknown, as your default position, your assumption as you face obstacles, then problems start to lose their bite.
Of course, there's a lot more to depression, and I plan to explore it more, but for now I wanted to highlight this one aspect as a first step.