How to Improve Logical Thinking? [closed]

Struggling to learn JavaScript

I already learn HTML and CSS which is not that difficult. But when I started learning JS it’s like I hit a dead end, although I’m learning something new everyday but when I encounter or think of a problem I don’t know how should I response and solve it. Also I often wonder how I will use diffrent methods in JS in real life projects. I want to improve how I think.