You woke that morning with a fresh idea in your head, and your convinced you're going to make something that is going to change your life forever. You had a big breakfast, you watched a videos of a cats playing the piano, and you finally have your computer setup. After you've setup your HTML document you question yourself about how the structure of your website should be. And after you lay some of your HTML out, you start editing your CSS.
This is how a lot of my days went before I got a good grip on how to approach projects. Most of the time I would work on one part of the application and only complete part of it before moving onto the next part without any clear goals. I would write some HTML, then switch the CSS and began styling the tags I've added. What I didn't think about at the time was that every time I added a new tag I needed to re-style everything I have already stylized because things didn't always work separately as they would normally work together. This would also bum me out while I was working on projects. Since I would constantly have to go back and fix stuff I had already worked on I didn't feel confident in my code.
It had a lot to do with practice. One of the first things that made me feel more confident about my code was seeing the huge changes I could make to my completed HTML after working with the CSS for fifteen minutes. I also stopped caring about how much CSS I was using. I followed along to a lot of youtube videos and people can do some really awesome things with just a couple of lines of CSS, and even though that's ideal - it all depends on how you want your project to look. I focused way too much on the semantics of my code before I just got into the functionality of it. Don't worry about optimization until after you have completed your code. You will slowly get better at on-demand optimization after you've worked on 3-4 completed projects. I also stopped trying to be as great as everyone else.
Just because certain things take you longer then other people, and it may take you more code to complete something that someone else can do with less - that doesn't mean that you aren't great. One thing I noticed while getting confident in my code was that I had to ween off of those videos where you follow along. I apologize to those who depend on those videos and make them but in my one hundred percent honest opinion you only learn 5% of what the goal of the video is. This is because you're watching someone who uses the quick and easy way to accomplish something and you start using things you can't understand entirely. Don't let yourself use black boxes because there's nothing more frustrating then not understanding what you're doing, especially when you have to go back and debug some errors later. You should only watch follow along videos if you already understand the concept, but you need a refresher on how to use it. If you need to learn something new and you do need to watch a youtube video on it, I would highly recommend you take the time to read the documentation or pay for a Udemy course on whatever it is you need to learn. Mozilla has my favorite documentation because it actually offers guides to follow along with.
Watching Youtube videos should come after attempting to understand the documentation.
But I promise you, in order to be a great developer you have to make some big sacrifices. It won't be easy, and we have all been there before. You just have to trust yourself, and always ask for help! There are plenty of people like me who would love to hear from you whether it be on this platform or another like Stack Overflow. You have the entire internet at your disposal, and an army of others who have been in your shoes. So make that cup of coffee, fill it with creamer and sugar, and type out the best program you can.