Most lockouts are caused by stupidity on the part of the keyholder.
Most of them. It was depressingly common to discover that the spare key to the car was on the same keyring as the one in use. As was every other key the idiot had ever owned. That made fishing them back out through a small gap next to impossible. Which was
my fault apparently
So, in order:
Get a spare key, even if it won't reset the alarm/immobiliser
Keep it somewhere accessible, even if that means phoning someone to bring it to you.
Always lock the car using the key in your hand!!!!
Then put it in your pocket - a bag can be lost or stolen. If you lose your trousers then you shouldn't be allowed out on your own.
When the bloke turns up to help, and goes through the list of the best options, don't get upset when he refuses to touch the car until you've signed a damage disclaimer. And a lot of cars are very difficult to break into - we
insisted that manufacturers make them so
And for the sake of your lock barrel, ditch all the unnecessary junk on your key ring