Well, I only ask about sleep because it exacerbated a lot of my problems. When I began to sleep better, I felt so much more capable and had an easy time focussing.
Like I said, I wouldn't give up (easier said than done, I know). Work on fixing the underlying problems first, and if you can make it through depression, then you can definitely recover your mental faculties too. Don't write yourself off yet!
See a therapist, even if it's just for coping strategies. I faced a lot of anxieties and regrets, even after the worst of my depression subsided - I felt powerless, afraid of failing again, bitter about screwing up my trajectory in life and wasting good opportunities etc.. It helped me to talk it out, make plans for my future.
Also, don't shoot yourself in the foot by resisting treatment because you feel it's pointless because you don't think that you're never going to get back to how you were.
I don't know how long it will take to return to normalcy. For me, it took a couple of years to recover from depression, and probably a couple of years more to 'retrain' myself, though this was as much as about finding new motivation as it was about learning maths. I still think I have a way to go, but I am making progress. That seems like a long time, but to me it was better than dying.
Finally, you also need to appreciate that there are two cognitive biases at work:
Firstly, you probably overestimate your prior capabilities because they seem so great in contrast to your own and because you remember it as such a good time in your life - it's nostalgia. You're not as far behind as you think.
Secondly, if you have not done much studying for a long time, then you're bound to lose your edge. I remember that between years at uni, over the summer holiday, I'd lose a little mathematical sharpness that would take a few weeks to return. That's perfectly normal.
In both cases, you're overestimating the scale of the problem.