I find that music helps keep me focused on the task at hand. I've got different playlists setup for my different developing moods. ie. learning, coding, designing, administrative, etc.
That along with actuall closing the IM, Email and IRC clients can go a long way towards helping you focus.
I also find that when learning something completely new it helps alot to have a small project to apply the new knowledge to. Even if it is something silly, it helps cement the new concepts in your long term memory.
The other thing is that once you done some work, and you're getting tired and finding it hard to concentrate, take a break. You tend to work more productively when you're fresh than when you're weary.