When you move into a house or apartment, have the locks rekeyed. There’s no telling who the previous residents may have given a spare key to, or whether they kept one themselves.
To avoid being locked out of your house, secure a spare key in a combination or key lockbox on your property, or leave one with a trusted neighbor.
Original locks may look quaint, but they are nearly always unsafe. Modern locks can be refitted while keeping the original integrity of the house.
Keypads are a good alternative to traditional locks in homes that are occupied or accessed by many people.
Be careful who you give your alarm codes and keys to; some alarms now allow you to give each individual their own code so as to monitor their use.