I already know some of the basic syntax but it is pretty hard for me to apply it when solving a problem.
Perfect is the enemy of good. Don't get stuck down in doing everything the "right" way at the moment, this will just lead to burn out and failed projects.
Iterate through your process and slowly nip away at the problem, you will find that you are excited to fix and refactor the application which will keep your interest up.
When you hit a problem stop and think about it, google it and fix it. You will learn a lot by just getting your hands dirty continuously.
If you are struggling to find programs to write, this is tough. Try some programming challenges that are gamified and you earn points for completing the task and also for the process takes to complete.
Examples:
I would suggest the book "The Talent Code" and from a different author "The Practicing Mind". One of the key takeaways is: always do things slightly beyond your capacity.
Yesterday I came across this post, and it is a good collection of ideas/thoughts. Not perfectly formatted, yet I am grateful to the author for having published it without reservations: [Effective Engineering] (gist.github.com/rondy/af1dee1d28c02e9a225ae55da26…)
Jason Knight
The less code you use, the less there is to break
One of the mistakes I see a lot of beginners make is fretting over remembering EVERY detail of EVERY function or syntax or method they use. This is really true of functions and parameters regardless what language you are using.
Instead focus on the techniques and that the functions/methods/objects/classes EXIST, then if you use them double-check your memory against the manual. PHP is a stunning example of this where php.net is a GREAT manual that's easily searched, is crossed reference, and filled with practical examples of not just usage, but in many cases WHERE something would be most useful.
Were that the official ECMAScript documentation was as well written and organized... or HTML... or CSS. I swear everything the W3C does is like it's written in Finnish, translated to Japanese by a Russian, then Google Translated to English. There's a reason nubes and rubes get duped into the halfwit bull that is W3Schools and people in the know go to MDN.
Use a function, use a class, use an operator you don't use very often, RTFM again. AS YOU ARE DOING IT!
It's part of why I advocate that beginners and experts alike should TRY to set up a multiple display system, that way you can keep a browser window to an online manual or PDF open on one display whilst coding on the other. Personally, I'm a three display kind of guy.