Do you have a clear view on your distractions? What's getting your attention? Look like don't the problem you're short on time but on attention. https://world.hey.com/jason/the-difference-between-time-and-attention-bdd955eb
I'm also a developer who's self-employed and I have learned to schedule my work with a weekly review (doing this with a template set up in Notion/AnyType) which forces me to reflect, learn and plan my week which are aligned with my goals. I love to freewheel a lot (I have that freedom) so it's easy to avoid the things which are URGENT & IMPORTANT to do. If I'm not doing those things, I will pay a price on the long term (like a client which is unhappy because it takes long to get my output for what he's paying for).
I would also like to mention I started a experiment with a other self-employed developer who struggles to manage his time to get the things done which costs much focus and attention. These talks we call encouragement sessions where we share our struggles + goals and encourage each other how to get it done / get rid of those struggles (saying NO to certain things is a strong tool for that). We also share every (little) success we achieve while working with just a simple message to each other.