Do nothing but that one task. Don’t switch to another task.
This means you MUST close everything that can hinder your flow. If you work on a computer, close everything that isn’t absolutely necessary for the task at hand.
From pianists to athletes, Mihaly found that people across a wide range of disciplines all identify a state in which they’re able to forget themselves and focus singularly on the task at hand.