Butt-in-chair is excellent advice, but it is not enough for everyone. I like to add the following before putting that butt down:
Come to the computer prepared to write. This means think through the scene you are planning to write. Think though who will be in that scene, what they will be doing, how they will do it, what kind of challenge they will face (if apropriate), where the scene will take place, what tone will be used, what pacing, how the scene will move the story along. When that scene is done, put your concentration on the next scene only. Even if some of the details are not thought out, the focus on only one scene at a time will help keep the other thoughts away.
Many new writers are paralyzed because they think about the magnitude of the entire story instead of focusing solely on the next immediate scene. Others are paralyzed because they haven't pre-thought about the scene-at-hand, instead relying on some mystical muse-inspiration to carry their hands around the keyboard. Both can allow a mind to wander, even if the butt is in the chair.
Letting other ideas get in the way could be a procrastination thing, it could be a serious lack of self-discipline, it could be both.