" If Mr X, a well renowned and highly educated professional could make this kind of mistake and still bounce back then you have a chance"
What I do is that I motivate myself from the mistakes/failures of other experts in the past.
If these people failed, then who am I?
Ask for help.
Whether it's a fellow developer on social media or a team member at work.
Opening up to someone about your feelings can be very helpful as he/she is most likely to give you words of encouragement in hopes of allaying your doubts and motivating you.
This is a strategy I use to remember syntax. I simply reason about one language/syntax in relation to another.
For eg,JavaScript uses semicolons and bracket parameters whereas Python uses no brackets, as well as indentation.
By relating them, I remember.
🔹Cleansheets
I have so many cleansheets saved in my computer. Cleansheets for Git commands, CSS selector syntax, JavaScript, Flexbox and CSS grids, Bootstrap classes etc are all saved on my computer.
When I get stuck, I just refer to them easily and quickly.