Failing an exam you didn’t study for us not a failure of character. It’s not your fault, and it is not worth valuing higher than your life.
Depression is telling you that you put too much weight on yourself. Do your best and that is already 100% of what you can give right now, and that is OK.
For me it always comes when procrastinating something worse. It’s not so much love as it just happens sometimes