Depression likes to trick us into thinking sideways. You say you fail at everything, but you successfully wrote this post. You successfully communicated your feelings. Self hate...well I've been told is depression turned inwards. Your thinking is in need of a tune up.
You are not useless in the job market as you have a job. Many people are having a lot of trouble finding jobs in this day and age.
Your studies...well that is tough. You just have to keep at it. It is not easy for anyone unless you happen to be gifted with an eidetic memory. What I wouldn't pay for one of those!!
Didn't you just mention an ex girlfriend??? You've got what it takes. You've got her, even if she's an ex now.
I know you feel like everything is burning right now, but depression comes and goes in waves, so try and ride it out. If you feel it's hanging around too much, a visit with your p-doc may be needed. Knock depression in it's you know what and let it know you are the boss!!!! Best wishes !!