Door doesnt lock

Open the door and operate the latch and lock mechanism manually. That should give you an idea if the mechanism is working as it should. If it is, maybe just an adjustment or clean/lube is needed. That's where I would start.