Realize that it's not just the pull of distractions that causes you to move towards them, but its that the thing you are trying to work on is uncomfortable. That discomfort pushed you towards the distractions. Next time, observe and pay attention to these feelings.
Note the distraction. Carry small sticky notes with you where you can note these distractions and come back to them later. Doing this activity enables your mind to compartmentalize these distractions
Use curiosity. Pay more attention to that particular thing what you are working on. Try to find something unique you have not noticed before and get curious about your work. That will enable you to get deeper into the job you are doing and help you keep away from distractions.
I encourage you to use these techniques in conjunction. I am confident that within one week, you can master them and start to see significant improvements in your ability to focus.