Write code. That’s pretty much it. Just keep learning and writing programs. Get good at searching for answers - MDN and Stack Overflow are great sources.
There are no shortcuts. Just learn and code things.
Write a few lines (about 5 lines is okay) of code every day, is good. Writing code that works as intended and without errors is better. And, having a small app with all that code over a few months is the best!