Watch your health. Being unhealthy can make you want to choose easier (lazier) tasks. Also, make sure you sleep well (not just long enough, but of high enough quality) since poor sleep can lead to laziness and diminished stress tolerance. I would recommend meditation or playing an instrument if the problem appears to be having too many things going on mentally at once.<p>Also, entertainment items give near-instant gratification and often very high stimulation. If you have been exposed to a lot of these lately, it may be necessary to stay away from excess stimulation for a while before you can adjust to the calmness of programming. Going straight to software would be like walking out of a concert and into a quiet library. Taking a long walk in a peaceful place could help.<p>The trick afterward is to avoid the urge for instant gratification.
Been currently using brain.fm to help focus. Allso looking for new work might be time if you're corporate. Also mediation/exercise can help alleviate this. Finally breaking big goals to tinier tangible goals can make something that usually you would procrastinate on more digestible.
In level of severity:<p>0. Control yourself
1. Use tools to block problematic websites (e.g. K9, StayFocusd)
2. Use tools to temporary disable internet (e.g. Freedom)
3. Don't do programming, take up a hobby that doesn't involve dodging mental crack the whole time
4. Get rid of your computer