Diagnosis
The machine thinks the door is open, even when it's not. This is usually a failure of the door lock switch (also called the door latch assembly), a very common wear part on front-loaders.
How to Fix It
Unplug the machine. Try closing the door firmly. Listen for a distinct “click” and a whirring sound as the lock engages. If you don't hear it, the latch mechanism isn't activating. You can inspect the strike plate on the door and the receptacle on the tub for obvious obstructions, but likely the lock itself needs replacing.
If That Didn't Work
Less commonly, it could be a control board issue not sending power to the lock. But the door lock fails way more often. If the machine fills with water but won't agitate or spin, that also points to a faulty lock, as it has a sensor to confirm it's engaged before starting.
Heads Up
Don't try to bypass the door lock. It's a safety feature to prevent the door from opening during a spin cycle. Forcing it can damage the door or the control system.