Rank: Guru
Rating: 94%, 894 votes
Without a brand or model number this will be very general.
If the machine will stop filling when you turn off the power to it:
Remove the tube which runs from the lower area of the tub up towards the water level switch. Cut off about two inches, or clean out the build up of gunk inside the tub end of the tube and poke a wire into the tub side of where it came off of to clean that out too. In the future, every few months run a load with no clothes, the hottest water your machine delivers, lowest water level, with several cups of regular liquid bleach added. This will help prevent the gunk from building up again.
If turning off power to the machine does not stop water from filling: Replace inlet water valve which is not sealing off completely