Windows: If you need to buckle down and avoid any distractions on your PC, Seriousd is a powerful time tracking application that can actively lock you out of specified websites and apps.
The video above should give you a pretty good idea of what to expect. At its most basic, Seriousd will monitor how much time you spend on various websites and apps, giving you a better idea of what's keeping you from focusing on your work. But even with this information, it can sometimes be a struggle to police yourself. If you really need the help, you can configure the app to lock you out of certain apps and websites after a preset amount of time. The only way to cancel the lockout is to reboot your computer, which should be enough of a pain to discourage you from checking Facebook again.
Seriousd's interface isn't what I'd call beautiful or intuitive, but the app is free, and very powerful if you struggle with distractions.