When you are locked out of your house, the most important part is not to give in to panic. If you need to take five minutes to cry or feel your feelings, that's fine, but don't let it overwhelm you. This is a problem with a solution, and it happens all the time, and you're gonna be okay.
First thing, you need to check the door. This may seem silly — you know you just locked it — but sometimes panic and upset do weird things to the brain. You may think you locked it, because you always do, but this time you didn't. You could save yourself a service fee.
Now that you're certain that the door is locked, take stock of the situation. Is there a baby in the house, something cooking on the stove, or an unattended flame somewhere? If there's a situation that could evolve quickly into an emergency, you may want to call emergency services in your area. Also, you'll want to assess the weather conditions. Can you wait outside safely for the amount of time it will take? If not, you may see if a neighbor is home and whether they'll let you wait inside for a bit. Most people are really understanding about this kind of thing.
Also important, are you expected anywhere? Work, meeting someone? Make sure, if you have an appointment or responsibility, you call them and let them know that you are stuck and will be late.
Next: do you know anybody who has a key and would be available to come get you in? Maybe you gave a key to a parent or a sibling. Also, if you have a roommate, they'll have a key.
Sometimes they won't be available, and you'll have to move to the next step, which is finding a locksmith who does lockout services. Most residential locksmiths do emergency lockouts, many 24/7, but you'll want to check before you call. Many locksmiths have a standard fee they charge for a lockout, so ask about that. That way you know what you'll be expected to pay when they show up. The time of day and distance from the location they will dispatch from can figure into this number, so it's hard to give an accurate estimate on this.
You will likely have to wait 30 minutes to an hour for someone to show up. Sometimes it will be sooner, sometimes it will be longer depending on where you are located, how busy the locksmith service is, and the traffic at the time of day you're calling. Make sure you inform the locksmith service if you're sheltering with a neighbor (or in the shed or wherever) so they know to call upon arrival.
When they arrive, they will either pick your lock or drill it out. If they drill it out, it will have to be replaced, but many will try picking it first. If you find yourself in this situation a lot, you may ask your locksmith about a good key safe while they're at your door; they may be able to direct you to a brand they recommend.
Once they have opened your house for you, they will want you to pay. Most of these services take credit and debit cards, as well as cash.