It's very easy. By being a boring developer! You get boring by not leaving things up to chance, but by having a strict set of process and guidelines you follow.
What exactly is a great software developer? For the sake of this discussion, let's say a great software developer is one that knows how to finish a project. Have the finished project working "correctly". Have the finished project is a decent shape where future maintenance and understandability is reasonable easy.
1) How do you finish a project?
By understanding that you live in a world of constraint, you have a limited amount of time, knowledge, money, etc. So you must place a limit on the features/scope of the project. You must understand what you are trying to build, what are the least more important amount of features that will deliver value and work on those. Folks usually call that building an MVP. Being a good listener, able to empathize with your users helps a lot here.
2) How do you know that your finished project works "correctly"
You get feedback from your userbase as you develop, you have Unit tests. You abstract the problem in a way that is so easy to reason about logically. You have a strict acceptance of what it means to work correctly.
3) How do you make sure that your project is easy to maintain and understand?
You follow good software engineering development guidelines. You name things well, you organize your code/source file correctly. Your code is self documenting. You use the correct tools for the job. You avoid "clever/shorthand/magic" code. You anticipate how your code will change in the future and code in such a way that it is malleable.
This means you have a strict process/checklist that you live and die by. You will feel almost like a robot more than an artist. This is "boring." But I personally this is what separates an average software developer to a great one.
To know the right tool, and process, means you have to constantly study. Have a well balanced approach to the SE field, don't just study programming languages and frameworks, study design, study the business side of things, study your tools.