You need to have a knowledge of a programming language and HTML/CSS, but also:
Take time to plan
Absolutely critical! It can be so easy to think that for the sake of getting a project or a feature done quickly, just diving into the code is the best idea. I can guarantee you that time spent with pen on paper (especially for bigger features) will save you time and produce better code. Even if it takes a while - getting your methods and thought processes in order will help no end
Knowing when to take a break
I’ve been there a million times - there’s that one thing you get totally stuck on and hammer you brain and struggle away even when you appear to be getting nowhere. My boss actually ordered me to get out of the office and take a lunch break against my wishes - it turns out he was right. It’s amazing what giving yourself a little headspace from an issue can do to help solve it.
Enthusiasm for the work
3 years in, I still find it a privilege to be doing this for a living - always remember what a cool thing it its we do. Those days when your day job is mundane and doesn’t enthuse you (you will get that in any job you do), go home and find an exciting language/framework to have a play around with. Look at the latest cool things that have been built and are trending - it will reaffirm your love for it and the possibilities of the awesome things you can built
Aside from actual unit testing/TDD/BDD which should always try and implement - an obvious thing is to be thorough with testing your site/app (or getting a colleague to do it) as a user before deploying anything and making it live for the client. Especially when its a big/new feature that needs to be put out rapidly - don’t just hoon it up onto the web without making sure you’ve made sure it works exactly as it should!
Ask for Help
I’ve suffered from putting too much pressure on myself to figure out every little thing myself - one thing you can’t be afraid to do is ask for help. Hopefully there will always be someone more experienced than you who can help you tackle a problem or write a function better than it is. Don’t be afraid to ask this person, or stackoverflow, or the many other communities (maybe even quora) - the only way you’ll get better is learning from the people that are the best. Also, choose a good web hosting partner.