The latch

My dishwasher will not fully close and work. When I shut it it will not click and fasten in order for it to run. I am not sure where the problem is, but I believe it may be in the latch in the door.