Talk to your University counseling services. They can likely help waive failed credits for diagnosed mental health issues, since they qualify as a disability. You can also possibly get accommodations such as extended due dates, etc, if you have continued mental health issues. Even without accommodations or getting credits waived, utilizing the counseling services for therapy or psychiatry can likely help a lot. There’s a lot of options and services likely available for you that you may not know about. I would have dropped out of college if I hadn’t started going to University counseling and I had failed several classes due to anxiety and depression. Seeing a therapist turned that all around and I was able to graduate and only had to take one extra semester. Hang in there!