You are going to have to open it up to find out where the leak is. It sounds like the fill meter hose has come off. How you get into the machine depends on what brand it is, so you might want to post another question to ask "how do I open the cabinet of a XXXXXX washer?"
Once open, you should see a thin hose coming from the side of the tub to a small meter in the control panel. This detects how much water is in the tub and turns it off depending on what setting you choose. If the hose comes off, the water leaks out as it fills, and the machine never thinks the tub is full so it never stops filling.
Once open, you should see a thin hose coming from the side of the tub to a small meter in the control panel. This detects how much water is in the tub and turns it off depending on what setting you choose. If the hose comes off, the water leaks out as it fills, and the machine never thinks the tub is full so it never stops filling.