Speak to your tutor/course leader asap.
You may still be able to organise an interruption of studies so that you could still return to finish your degree in a year or two when you're in a better place mentally.
Even if you know you don't want to complete in your current uni, you should still talk to them as they'll be able to give you info/advice about the best way to go about things and if any of your credits can be transferred etc.
They may even be able to provide you with reassurance and support to ensure that you can still finish with the grades you want.
Apart from anything else, they should also be able to help you with pastoral and other stuff outside of your studies.