At first I viewed the depression I started fighting in my teens as a scourge, a defect, something broken to be fixed.
I have since come to see it as an important signal. When I am managing my life and mental states well, it often fades into the background. When it starts to flare up, like with some kind of physical pain, that's telling me I need to pay attention and change things up a bit.
Furthermore - and perhaps most importantly - it is a preferred failure mode to freaking out or engaging in suicidal ideation. When I'm overwhelmed by that gloom, I remind myself that I could have a stroke, aneurysm or heart attack at any moment, and I think about what the consequences would be if I did. As long as I'm in a safe situation, I can simply take my first opportunity to Just. Stop. Taking time to shut down, and to cease forcing yourself to engage with a world that would go on without you if you suddenly died, is a good idea now & then.
Yeah, at times I feel some twinges of guilt for doing this. It seems selfish on the surface. But when you compare it to the alternatives, well-- it's better than being dead, isn't it? I feel like my ability to manage my life (and depression) has improved considerably with this insight. If you need to stop, stop. Rest. Let whatever is pushing you to the brink simmer in a corner for a while, provided it is physically safe to do so. You will be better equipped to deal with it when you've had a chance to breathe, and to remind yourself that a temporary shutdown is indeed better than being dead.