It sounds like you are controlled by your thoughts. I'm looking into the concept of "Mindfulness" to get more control back and find more happiness. I also found that doing one workout every morning greatly improves my well-being and reduces thoughts that limit me.
I, too, struggled with wanting to to everything as best as possible but found that it really limits me. I eventually just started with very small iterations and even though I didn't write a lot of code yet the process itself already taught me quite a few things. The great thing with code is that you can come back later and improve it, so it doesn't have to be perfect on the first try!