If you're old enough to be going out by yourself you're old enough to have a set of keys. Forget your keys, good luck getting in. Start contacting others and go and collect from whoever is the nearest.
Great advice for everyone who never gets robbed, loses anything, forgets their keys at work, gets their car broken into or has a serious accident, can remember everyone's phone number off the top of their head and doesn't live alone!
Spare keys in useful places are for emergencies, which do happen sometimes otherwise the word 'emergency' would not exist.
I've actually never had to use mine in this house but I can recall two previous occasions when I got home from work with no keys - one was where I had driven to to work, dropped the car at the garage for its MOT, taken my house key off as it had my locker key with it, used the locker key to open the locker when going home and left it in the locker, which I didn't realise until I got home as I had my car keys. And I had also managed to not realise until after I had clicked the steering lock on, the key to which was also on my house keys at work (which wasn't 24 hour and this was pre mobile phones).
The other time, I was the last to leave work. I had my keys (home and work, but not car) in my hand and left to go to the loo, and dropped the lock catch. I then went back in to get something I'd forgotten and left again having put my keys down when I was getting whatever it was, and not picking them up again and the latch was down. I didn't realise, I just checked the door was locked and left. I was seeing a mate for dinner, went straight there, I worked 50 miles away so after dinner I drove 50 miles, only to get home about midnight unable to get in. I did have a mobile phone then so had to call said friend and go back 50 miles and stay the night with him! Keys were on the desk next day where I had left them.
(Twice going back to work in the same clothes as the day before too! Different jobs though - incidents at least 10 years apart)
Obviously they were both pretty stupid things to do, but sometimes we do daft things. Everyone does sometimes.
Dp has used my spare key actually. He was here and I left for work and locked the front door, forgetting he didn't have a key. So, he was locked in. He went out the back door, round to the shed (which is at the front and it's a terrace so you have to walk round the backs of the houses to the end and up the road|), got the spare key, let himself in, went back and locked the back door, then left using the spare key to lock the front door and put the key back in the shed. I was at work and suddenly at some random point in the day, thought 'OMG, I've locked him in!' so I texted to see if he was OK.