Make sure uni know you have depression. It might be a bit late now. Many people including me had depression or any circumstance in our uni days. The right step is to tell them you have depression and extend your deadlines BEFORE the deadline. If you explain it well, they can even let you submit your coursework on July/August without cap your mark. I don’t know what uni you are in but failing the same modules twice is very serious. Your course co-coordinator should be in touch with you by now.
This is my story I hope it helps you. I had a very bad depression before and I can total feel you. It felt like it was the end of the world. Because I failed my first year twice in my first uni, and I had a lot of explaining to the uni, but of course they have to kick me out because of my low gpa. My last uni was a top 100 uni in the world and all they care about is my gpa was too low. They didn’t want me to be there and told me to get a boring job without a degree. I applied with ucas and went to a new uni with a new course, I had to write a 2 pages statement to explain why I failed my last uni due to depression and I got in. I graduated with 2:1 Honour degree last year.