Advanced mathematics is a very difficult subject for most people. Even in a good state, there are many questions that make people feel scared, and this purely theoretical thing is just to cope with the exam, which is difficult to remember.
Depression may have some effects on your emotional state, the intensity of learning motivation and the speed of acceptance, but these effects cannot be changed in a short time. Don't worry, you can keep up with your study step by step. It's only a matter of time. Don't be too hard on yourself. Give yourself more time and you will gradually see your progress.
I wish you progress in your studies and good health.