Here is one thing that helps me:

Block out __work time__ and allocate _relaxation time_ for each day (relaxation does not mean sleep).  You cannot work 100% of the time, but you need to be vigilant about _not_ engaging in leisure activity during a work time block.

Intersperse designated _play time_ in between work times, __but do not let the two types of time periods overlap and become blurred__.  If you find an interesting website during working hours, _bookmark it and come back to it during the next play time period_.

Basically work during the work time, play during play time, and maintain consistent waking/sleeping patterns (try to go to bed on time).