Stephen King has written a famous book about writing, called appropriately, On Writing. Here is a snippet of advice from an article in 1986. It may be old advice, but still very valid.
Never look at a reference book while doing a first draft
You want to write a story? Fine. Put away your dictionary, your encyclopedias, your World Almanac, and your thesaurus. Better yet, throw your thesaurus into the wastebasket. The only things creepier than a thesaurus are those little paperbacks college students too lazy to read the assigned novels buy around exam time. Any word you have to hunt for in a thesaurus is the wrong word. There are no exceptions to this rule.
You think you might have misspelled a word? O.K., so here is your choice: either look it up in the dictionary, thereby making sure you have it right – and breaking your train of thought and the writer’s trance in the bargain – or just spell it phonetically and correct it later. Why not? Did you think it was going to go somewhere?
And if you need to know the largest city in Brazil and you find you don’t have it in your head, why not write in Miami, or Cleveland? You can check it … but later.
When you sit down to write, write. Don’t do anything else except go to the bathroom, and only do that if it absolutely cannot be put off.