Just because you're not having the outcomes that you want does not mean you're a failure.
Depression and feelings of inadequacy and failure are a vicious circle, because ... depression makes it hard to succeed.
Depression also makes it hard to connect with people, and hard to stay connected.
Depression also makes it hard to take care of yourself.
Try to find a primary care physician, or a therapist, or a similar professional. If you don't like who you find, for whatever reason, find a different one.
Treat them like a project manager. Be sure to be actively involved in choosing your management tactics.
I've tried suicide twice. Once when I was five. Once when I was about your age. I'm 63 now, and I'm glad that I didn't succeed.
Only within the last ten years did I ask for professional help. It saved my life. Most of my life prior was like dental work without novacaine.
Two of the things that have helped me (YMMV) are a prescription, and a career change.