Write down your ideas to clear your mind.
I've found that oftentimes when I try to be super focused in one area, my mind will go to different things other than that which I'm trying to concentrate on. One of the most helpful tips I've adapted and found works really well for better focus is writing down what your mind tries to go to.
I originally heard that if you've got a song stuck in your head and cannot get it out if you listen to that song, it will often release you from that loop. I applied it to my thoughts that interrupt my train of thought and found it actually works quite well. By writing down the ideas that are constantly going around my head, I am basically telling myself that I acknowledge the idea and filed it away for later research.
Trying to push the idea away only makes it harder to keep off your mind as your subconscious is afraid you will forget it and views it as important. I've also heard a similar practice when meditating; if you acknowledge your thoughts, then let them go, your brain will sweep them away and allow you to focus on your breathing.
Key takeaways:
1) Write down your ideas to clear your mind for focus
2) Writing down your thoughts, acknowledges them, and files them away for later
3) Pushing the idea away only makes you want to think about it more