A safety lock is a mechanism used to lock a door or other entrance, to prevent unauthorized access and ensure that only those with the correct key or code can open it. Safety locks are often used on doors, but can also be used on other entrances such as windows and cabinets.