If the water is overfilling the the problem is usually related to the water level switch, air dome or clear plastic pressure hose.
You don't mention any details but the water should stop filling when the washer is turned off or unplugged. If the water keeps filling when the washer is turned off then the valve is the problem.
The wiring diagram for your washer in the image below may help with this problem.
As water fills the tub the air dome sends pressure up the clear plastic hose to the water level switch. As the tub fills the pressure increases till the water level switch trips from the violet to pink circuit for fill to the violet to tan circuit for agitation.
If the switch doesn't trip it most likely is because the switch is bad but the air dome can be blocked or the hose may have a pin hole or be kinked.
The first thing to try with this problem is to access the water level switch by raising the console. The 1st image below will show how to do this. Your particular washer has two end caps that must be removed to access the two screws holding the console down.
With the console up and the washer empty remove the clear plastic hose and blow through it towards the tub. You should be able to blow without to much difficulty and you might even hear bubbles from the sump of the washer. If you can't blow are there is difficulty then the air dome is blocked or the hose is kinked.
The air dome is part of the out tub.
After blowing through the hose reattach it and see if there is any improvement.
The 3366845 water level switch and 353244 hose are both available from the following link:
I hope this information is helpful to you but submit another question with any additional details for further assistance.