A lock is a tool that keeps a room, house, drawer, or box securely closed. You generally need a key, password, or combination to open a lock.
You might use a padlock on your gym locker, opening it with a tiny key or a secret series of numbers. There are also locks called "bolts" like the one on your front door, and bicycle locks that protect your bike while you're at work. Lock also means "to secure with a lock" or "keep securely enclosed," like when you lock your goat in the yard to keep him from eating the neighbor's rose bushes.