couple people in my life if a few things happen they start getting discombobulated and thinking about thing 1 while doing thing 2 and so something happens while they do thing 2. they bang into something with their car, for example. you have to slow down your brain and your life and focus on the thing before you. really focus. not be thinking about what else is going on. do that thing well. execute. complete the task. on to the next thing. separate it out. don't approach it as one big mess.
get real disciplined. start churning out work. put time into each task and make it high quality. try to maximize grades per task. punt socializing to next semester or until the issues are under control.
assuming we are talking college, that should be your primary concern. buckle down. get the grades up. few weeks left in most semesters. work hard. study. try to do your best on grades, fix it best you can. your grades are going to dictate whether you get to stay, to compete, or to transfer. if you take a GPA hit then your transfer choices slim down.
you might consider selectively dropping bad classes if W doesn't count against you, but if you do too many you might get in a "progress towards graduation" situation for financial aid or sports. so you can't really quit everything.
i would treat sports (and meals and such) as break time from trying to fix your grades. just work work work on school. then when practice or a meet comes up, "go for a run" so to speak. take your materials for meets. it's dork stuff but academics needs to be the focus. you have to do that for sports or transfer or the rest to exist.
grades are normally tilted towards finals mattering more. put your energy into preparing and catching up for that. you can fix a lot that way. see if there is extra credit. do that well.
in the future, next time you have a crisis developing, see someone, head it off, and see if you can briefly make some space between you and your obligations for a few days. if you fight your problems rather than let them swamp you, you win instead of the malaise. you can also take INC and finish things later in the spring or summer. but that only works well if you stop before you dig the hole too far. and you can selectively drop classes, if you start off with healthy hours each semester, and find yourself in trouble. when i started i would never do stuff like that. by the end, it was like a reflex. ironically, better grades, as i protected myself from the snowball going downhill effect.