I agree with talking to a guidance counselor. See what you can do to catch up. If you can’t catch up this semester, I think there is a good chance you can double up on required courses next term (which might mean repeating a few courses from this term) and still graduate. Most people graduate with many more credts than they need. Almost all schools require 4 years of English, so you might have to double on English, but many school districts require less than 4 years of science, math, and other required studies, so it may not be a huge deal. You would want to find out if withdrawing in the beginning of the year affected your GPA, or if it is just noted on your transcript that you withdrew.
I recommend you go to your doctor and have some basic bloo dtests that check sugar and especially thyroid, rule out any physiological underlying cause that would make you lethargic, unmotivated or depressed. Literally underactive thyroid can make people depressed. Maybe also talk to a counselor to dig up some other reasons you might be depressed. Depression is very common in teens, you are not alone. Many times it stems from loneliness, but there can be many reasons. If you seem to be affected by shorter hours of sunlight and live where it is very grey, consider a sun lamp that treats people for Seasonal Affective Disorder, and you can also check your vitamin D level with those blood tests, but I have no heard of vitamin D directly affecting mood, but since sunlight does, maybe there is a connection?
If the school will work with you just force yourself to conform, do what you need to do and get through it if you can. You might feel miserable physically and mentally exhausted, but I think it is worth it. However, seeng the light at the end of the tunnel and having taken hold of what you want to do might inspire you to work harder. I doubled up the beginning of my senior year, I wanted to leave school early, and it was the best term I had in high school. It was my hardest term, I took an AP science course, two English classes, but I also was able to help a teacher my first period who did not care if I was late, and I could sleep an extra hour in the morning which help greatly. I had never been a morning person, I probably had some mild depression at that point, and arriving to school 15 minutes late meant much more sleep because of rush hour patterns. So, I was not even taking a class for credit that first period and I still had plenty of credits midyear my senior year. I knew I just had to get through a few more mo ths and I was done, so that was very motivating to be very focused. I wish I had worked more closely with advisors and teachers planning my schedule though.
Another motivator for your school is they probably get money based on how many students are enrolled, so if you come back they get more money.
The other option is a GED of course.