There is a saying, "The perfect is the enemy of the good", which is often attributed to Voltaire. Essentially it means that if you strive for absolute perfection, you will never actually achieve anything.
This plays a big part in software development, and even more so in indie or side projects. And I'm especially guilty of it.
There is a certain point where the code has reached MVPÂ¹, where it does what it needs to do and where it's possible to maintain it and sort out any problems in the future. When you get there, you should stop. If you are personally invested in the code, you will find it hard, but if you keep going until it's perfect then you'll never get to the next piece of work. And that, in turn, means you'll never finish.
Don't let perfect be the enemy of Good. Aim for Good Enough, for MVP, and make it better later. This way, you'll actually find you progress better, and maybe finish something.
(And, as an added benefit, as you use the code that you think needs improvement, you'll find that maybe your concept of the improvements it needs are off)
1) MVP - Minimal Viable Product. The least work needed to get to market.