Cal Newport proposes in Deep Work the following formula:
work accomplished = time spent X intensity
I think it's a spot-on analysis: you can't do your best work while multi-tasking or constantly switching between cognitive contexts.
The formula also mirrors the definition of momentum, which is equal to the mass of an object times its velocity. The more momentum an object has, the harder it is to stop.
In terms of work, however, momentum has an upper limit, it's more of a Gaussian function: momentum is hard to accumulate in the beginning, and gradually fades away after reaching peak productivity (flow). Reaching peak velocity causes you to lose mass.
Working on your productivity is basically training to quickly gain cognitive momentum while keeping your state of flow constant and stopping willingly right before will power starts dropping (taking a break). In other words, your inner Gaussian function slowly takes the shape of a plateau.
I can't teach you how to do it since everyone is different, but once again, it's just a matter of habits.
I get into momentum by starting my day with small urgent tasks, before moving on to more important ones. I don't count my hours but I do listen to what my body tells me. If I feel sluggish I just take a break. I always reward myself when I accomplish something, by logging my tasks for everyone to see for example, or by having a snack.
What I do outside of work is equally important. I remove distractions, and I don't hesitate to spend time day-dreaming.
Just do or don't do, there is no in-between.