Washing machines may not work if their lid switch is defective. It is usually located near the door and will need to be replaced if defective. 

If washer drains and fills at same time drain hose might be too low.  Drain hose should be at least 3 feet above floor.

A clogged drain will keep water from draining,. 

A water pump may have a frozen pulley or broken impeller and should be replaced. 

If there isn’t any hot water, make sure the hot water is turned on.

If there isn’t any cold water, make sure the cold water is turned on