Getting something accomplished is key for me, code-wise that might mean I write a script in 10 minutes to pull weather data from an api, or an image from NASA. Keeping the task small lets me get a positive shot before I can burn out.
I have to break project sized work into smaller mini projects, or I get intimidated. I accept that I’m weak and easily distracted, I guess I’m treating myself like a child. Who cares as long as it works?
I also let people take advantage of my agreeableness. Only solution I’ve found is to change jobs every couple years.