Kids and pets will get out, or for your own peace of mind, it's important to keep the door closed.
Here's the trick...
Step 1: Pencil + Eyelet
You need a small eyelet and a pencil (or an erasable marker), that's it.
Get the latch (part that moves up and down) to its highest position and
draw a short line a bit lower than the bottom tip of the latch on the side of the door.
Close the door and extend the line to the eyelet side of the door
Open the door and position the eyelet at the line mark.
Screw/unscrew the eyelet so the door is easy to lock.