Flaubert once said, "Be regular and orderly in your life, so that you may be violent and original in your work."
Go to bed at roughly the same time. Get up at roughly the same time. Eat breakfast (prevents sugar crashes later in the day). Do some light exercise when you get out of bed (7 min workout, holla) and then meditate. Do actually intense exercise once or twice a week. Snack a few hours after your lunch.
Take care of your body and keep it prepared for the work you have ahead of you.
When you get to work, plan out the rest of your day. Write down what you intend to do (you get a lot better with being realistic with this list) and split it out. Don't open HN while you wait for your tests to run. Timebox everything else.
Also, take regular breaks. Get up, stretch, go for a walk, read for a bit.
Procrastination I find is closely linked to mood, so make sure you've taken care of that as well.
I do 80% of the above and I still have procrastination spirals but it's gotten a lot better.