It sounds your brains need some serious rewiring. I wouldnt worry about coding or focusing intensely at anything, just start exercising, doing hobbies and hanging around / making friends. Maybe a job that is more hands-on. You need to reprioritize and let go of the past failures. Therapist would probably help as well, but best is to learn to how to help yourself first.