that sounds really difficult, try and talk to university support, your supervisors and fellow students, after that go through what was stressing you, do whatever you can to relax before and whilst your studying, you can even try and study with some friends who are more comfortable with the material so they can help you, if you still don't like the course after you PROPERLY AND THOROUGHLY understand some of the content you've been finding difficult/frustrating then honestly, it's your decision to make but I would leave. of course don't leave out of impulse weigh the positives and the negatives and look for other suitable paths before you do anything. but first, and I can not stress this enough, get support and UNDERSTAND the material, most of the time when people don't enjoy something it's because they don't understand it, also try and make it a bit interesting. some of what you learn could have a cool history or fascinating applications. past that if you still don't enjoy it, then look for other options and leave, it's not worth the stress and exasperation, they're probably countless other things you could be doing that would better suit you, your future and your mental health.