Whether you should restart the course or keep trying depends on what exactly you find hard. If you find it hard to write something on your own, I’d suggest going over the courseware again or trying to do several tutorials that create something using JS.
If you’re finding it hard to design a project and then implement it due to the sheer size of that task, break it up into manage-able chunks (you can split the tasks till you are left with something that can be done using a single line of code, then just complete a bunch of lines and see if you can make it into a function that does one thing and does it well, then see if you can combine several functions into a block of functionality and so on).
If you’re struggling with something specific and you know how it should work, then you should try to google how to implement this specific thing (but you need to know how to spell it in a way that google understands so you get relevant results… praying is said to help because lately google tries to sell you stuff instead of finding what you want… oh, and NEVER search anything negative, it will try to cheer you up instead of finding a solution to a problem, best search results I had started with “how to”, instead of “I cannot”).
Having a mentor / tutor sometimes helps. From my personal experience: I had tutors in several disciplines in University (and some at school) and that really helped me excel in those topics. But, at the same time, I never had anyone to teach me programming, so I learned everything by myself. Internet and a few good books really helped.
So if you can, get a mentor. That should help with parts you don’t understand (I’m mentoring yet another student right now, they say it helps a ton). Just make sure you put enough effort in, so it isn’t like your mentor does everything for you. That would be counter-productive in the long run.
Also, if you’re stressed, take a break. A few days or a week should suffice. If you get back to it and become stressed again, think whether you want to program in JS. Try another language, like Python or Java.
In the worst case, think of a different profession. Programming is a niche job, it isn’t for everyone. Some people are better in sales, others in sciences. You can always take a break, try something new, then come back to programming. If you take breaks in learning, it helps in figuring things out (at least sometimes). If you decide to keep on programming - that is awesome. If you decide to do something else - that is also awesome. Do what you enjoy. And have a great day!