Do you own a vehicle that only came with one set of keys? Do you know what you would do if you accidentally misplaced or otherwise lost the keys you have? Nobody ever plans to lose their keys or to lock them inside of their vehicle; it's just something that happens. But what you can do is plan out how to handle the situation if it does happen to you. Losing your keys isn't something that has to be super complicated or stressful, especially if you've set out a plan ahead of time. Some things you'll want to do include:
Finding a locksmith: The best time to find an auto locksmith is before you need to call a locksmith. Not all locksmiths are able to open vehicles, especially if you have a newer car. It may not do much good to just get your car door open if the keys aren't inside. If your vehicle has an electronic sensor that detects whether you have a valid key or not, you'll need to find a locksmith who is able to make you a new key fob so that you can actually start your vehicle and drive away. The sooner you are able to find a locksmith who can do this, the better.
Getting duplicate keys: Your car dealership may have told you that it'll cost you several hundred dollars to have them make you a duplicate key. This is not the true cost of having a duplicate made. In this price, you're also paying for the privilege of getting the job done at the dealership. In contrast, an auto locksmith tends to have a very low overhead and is able to charge a fraction of what you'd be paying at the dealership. Instead of paying a few hundred dollars for a spare set of keys, you'll usually pay less than a hundred.
Setting aside money: It's a good idea to always have some money set aside for an emergency fund. This may be so that you're able to pay the auto locksmith to come to unlock your car door or it may simply allow you to get a new spare key cut once a friend or relative brings you your current spare car key. Every week or at least once a month, put a few dollars into an account that's not the main one you use for your usual day-to-day life. Once the money is in there, pretend it doesn't exist unless an emergency arises where you need to pay the locksmith for his or her services.