The classic 'spare key under the doormat' is a thief's first stop. Same with magnetic boxes on the vehicle frame — every car thief knows the popular hiding spots.
Better strategies: a trusted neighbor or family member who lives nearby, a hidden lockbox with a combination (mounted somewhere not obvious), a spare in your desk drawer at work, or a spare in a wallet/purse different from where you normally carry keys.
For vehicles: spare keys are easy and cheap for older cars. Modern cars with transponder chips cost $100–$300 to program. Make a spare anyway — the cost of a lockout is similar.
For homes: at least one spare with a neighbor and one in a hidden lockbox is good practice. Never the doormat, the planter, or above the door frame.
Digital spares: smart locks with codes you can give to friends or family eliminate the physical spare problem entirely for the home.