This is something that can only come with a lot of practice, repetition and exposure. I usually start by learning the "thinking words" in their native tongue and echoing in English what they've just said. That point, when they are trying to gather their thoughts, is the moment when the brain will switch back to mother tongue.... so for instance, I had a lot of students going "eeee~to..." in Japanese, so I corrected them when I heard it and said "hmmm.." or "One moment." (I don't teach uh or um, as they will use it too much and sound like they are stuttering!)
Now that my students know "I'm thinking" phrases, they are switching back to Japanese far less.