Getting locked out of the bathroom is an irritating situation but definitely not the end of the world. There are quite few ways to open the bathroom door by yourself.
It is very important to stay calm in order to to get it done and if all fails you can always call a professional locksmith for help. So take a big breath and let’s start!
Use a hooked hanger
A hooked hanger is one of the oldest and simple methods to open a locked bathroom door.
To begin take an ordinary metal hanger and straighten it out then use pliers or just your hands to create a strong hook at one end of the hanger, then insert the hook side into the gap between the door and frame and make sure that it wraps around the latch properly.
Now hold the hooked hanger in one hand while turning the doorknob with your other hand while pulling back on the hanger towards you, be patience with it and with no time at all you should be able to open your door!

Use a bobby pin
Take a bobby pin and straighten it out, insert it into the middle hole in the doorknob. Jiggle the bobby pin gently while turning the doorknob until the lock disengages.

Use a credit card
Credit cards can come in handy to open locked bathroom doors in fact they can unlock almost any type of doorknob thanks to their flexibility.
Slide the card between the edge of the door frame and the lock exactly where the latch is located and bend it slightly while pushing against your the door.
Push and pull the card against to latch untill it eventually it opens.

Try A Butter Knife
In cases where no credit card or bobby pin is present then perhaps using a butter knife could be useful too.
Insert its tip of the knife into your keyhole just like how you would do when inserting and try to turn it gently like a key until the door is open but please note that this method works best with push button locks.

Remove The Handle
Removing the entire handle or doorknob off is another solution, check out the screws found at exterior side and remove them and when its out take the screwdriver and insert it gently right in the middle and turn it to open the door.
