There are many kinds of locks, from car locks with security chips built in to locks that open with a plastic card instead of a key. But the two most common kinds of locks are the key lock, like the one you probably have on the front door of your home, and the combination lock, like the one you may have on your locker at school.
Both of these kinds of locks have something like a puzzle built inside the lock that has to be arranged just right for the lock to open.
Most key locks used today are cylinder locks. The parts of a cylinder lock include the bolt, the strike plate, the cylinder, and of course, the key. The bolt is the part that shoots out from a door lock and into the door frame. When the door is locked, the bolt cannot be pulled back by just turning the doorknob; it requires the use of a key. The strike plate is the metal part that attaches to the door frame. The bolt passes through the strike plate when it goes into the door frame.