A lock is a mechanical or electronic device used to secure an object, such as a door, container, or piece of equipment, by preventing access or opening without the appropriate key, combination, or authorization. Locks are crucial for security and are used in various settings, from homes and businesses to vehicles and personal belongings.