Try not to edit while you’re creating your first draft. Creating and editing are two separate processes using different sides of the brain, and if you try doing both at once you’ll lose. Make a deal with your internal editor that it will get the chance to rip your piece to shreds; it will just need to wait some time.
A really nice trick is to switch off your monitor when you’re typing. You can’t edit what you can’t see.