before any kind of work and then I put up stickers with "do not even think it!" on it.
Infinity meditation is very fun and makes one think of... Well INFINITY and makes one calm
Also use your alarm clock in your cell phone so you only have like 30 minutes for online social websites when you get up(or after work) and then these sites are made forbidden zone for the rest of the day.
God knows how much time I have wasted in the past doing this "evil loop of never ending repeat"