The habit and dopamine release in working out

What creates the habit and dopamine release in working out?

How can one create a routine and stick to it through the work of psychology and neuroscience?