Check the washing machine's power cord to see if it is loose or damaged in any way. If the cord is slightly loose but not completely out of the electrical outlet, this can easily cause intermittent power failures. Similarly, if the cord is damaged, it will need to be replaced to restore consistent power to the washing machine.
Plug another appliance into the outlet temporarily for testing purposes. If power is intermittently cutting out when using the washing machine, the problem could be with the electrical outlet itself rather than with the washing machine. Since most washing machines use a standard, 120-volt outlet, an easy troubleshooting technique is to plug another appliances into the same outlet to see if its power cuts out intermittently or if it stays consistent. If power cuts out on the other appliance as well, you will need to have an electrician examine the outlet.
Use the washing machine on a dedicated circuit. A simple explanation for this problem may be that the washing machine is sharing a circuit with other electrical appliances and exceeding the load of the circuit. Many washing machine manufacturers recommend using a washing machine on a dedicated circuit to avoid this and other electrical problems.