Make sure that the water supply faucets behind the washer are fully open. Check for frozen fill lines in the winter. Unplug the washer and disconnect the fill hoses from the back of the washer. Check for proper water flow through the fill hoses. If water flow is inadequate, have a plumber repair the water supply to the faucets.
If water flows okay, check the inlet screens on the water inlet valve assembly. If the screens are clogged, replace the water inlet valve assembly rather than cleaning the screens (cleaning could allow debris to enter the valves, resulting in the valves sticking open and causing flooding).
Check the drain hose for proper installation. An improperly installed drain hose causes fill water to siphon out through the washer drain. Also, check the drain pump for debris because items such as paper clips and coins can prevent the washer from draining properly and allow fill water to siphon out through the washer drain.
If these suggestions don't solve the problem, the inlet water valve assembly probably needs to be replaced.