Suicide isn't always just a way out of problems, sometimes people just don't want to live anymore and there's no good reason for it other than how their depression has affected them. Depression being a mental illness means it affects your brain and makes you think in ways that aren't always very logical or forces thoughts into your head that would make absolutely zero sense to someone without depression. It's not always that the person honestly sees a good reason to kill themselves, or they're seeing it as a way out of a problem, usually they just really don't want to carry on living anymore because they're tired of it, a lot of time a fear of death is all that's stopped them.