If you have ever binged watched a Tv Show, spent time with someone you love or enjoyed what you do for a living. You will quickly see that 24 hours is not enough time in a day, with a little math you will realize you actually have nothing even close to 24 hours to do those things. You have to learn how to prioritize and strategize about how to spend your day in such a way that you get the most bang for your buck.
I have found this is the best way to treat your time spent programming. As a developer it is easy to get carried away coding things because they are fun to you. A lot of people gravitate to parts of a project that they have interest in. It could be optimization problems, design problems, growth problems etc. When creating a product it is essential to remember that you are providing a service to a client/customer. These are the only people that matter in your project. No one cares that you refactored the layout code from 100 lines to 82. No one cares that you spent an hour upgrading sublime and adding the best theme for readability. No one cares that you upgraded the project from using pure CSS to using Sass. Your clients and customers only care about what impacts them. Understanding that at the end of the day this is the only metric that matters puts things into a clear perspective.
Every time you sit down to do a code related task the question to ask yourself is how does this affect my clients/customers experience. Do not fall into the trap of calculating implicit benefits, like if I have a better theme I would code faster. Throw that shit out the window. There is a time for that but it is at the bottom of your To-do list. Pick the items that change your clients/customers experience immediately, work on those first and everything else is secondary.
Every time you sit at your keyboard visualize what tasks for the limited amount of time you have would be the best bang for your clients' buck. That is what you should work on.