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.