How to learn good programming practices? Create Frankenstein monsters: patched code so ugly it becomes a pain to maintain.
Mental pain is the best teacher. It forces us to find a solution, and fast.
I made a Content Management System for an ex-girlfriend's portfolio website when I was 21. It was coded in PHP. I had heard about the Model-View-Controller design pattern while I was studying software architecture in college, and I wanted my CMS to implement it. The codebase was so awful it still hurts, but it taught me a lot about software development and I landed an internship in Geneva when I mentioned it. I had to adapt, so I started learning a professional MVC framework called Symfony to do all the heavy lifting for me. My productivity had easily tripled, and so did the quality of my code.
Last week I started hitting the limits of what I can do with React alone. I made this editor tool using DraftJS and React, and even though my code is modular (as much as it can be anyway), the parent app file managing all the states is getting too big to maintain. This is why I'm now learning how to break it down into independent components using a Redux store.
Do things even if they don't scale, and refactor when it becomes too painful. Next time you attempt a similar venture, you'll get a better feel of what you have to do. All great engineers have their own Frankenstein monsters, so don't be afraid of making broken things: always prioritize learning experiences, and remember there is always probably a better way to do things, so shut down your inner perfectionist and start hacking.