For top-loading machines; turn off the power, and locate the drain pipe. Washing machine pipes are often colored red for hot water, blue for cold water, and gray being the drain pipe. Disconnect the drainpipe, and empty it in a bucket. Reconnect the drain pipe and repeat until the water is done.
For front-loading machines; turn off the power and using the owner’s manual locate the drain pipe within the back panel. Different front-load washing machines have different pipe settings- some have a single drainpipe filter or a drainpipe filter and a separate drain hose. Drain the pipe and clean out any residue you find on the filter.