You can drain a little while the engine runs, but it will airlock if you run too much out. Depends on your level of contamination. It is usually better to drain it off, before starting the engine and then refill the filter housing with clean fuel prior to starting. It works best if you can gravity feed the filter housing from the tank. If not then have a small jug on hand just to fill up the housing.
" Wisdom; is your reward for surviving your mistakes"