I'm sorry you're feeling down and unmotivated. Have you checked out your university healthcare and wellbeing services yet? They would be great at helping you work through your lack of motivation. You shouldn't have the feeling that you're going to fail because that will never motivate you to actually write something down or complete a project. Speak to your department as well and I'm sure they'd provide further assistance and/or extensions to any coursework you have due.
Hope this helps,