To enter flow, you need appropriated self-control, environmental conditions, skills, task and rewards. Besides that, you must know what you’re doing, be able to see whether or not you’re doing it well, and be pushing yourself outside of your comfort zone.
The last point is especially important, it's mastery combined with challenge that brings flow. Too much challenge and we get overcome with anxiety. Not enough, and our brain loses focus and looks for other stimuli.