If you find yourself in a situation where you need to unlock a door with a bobby pin, there are a few things you can do. First, try to slide the bobby pin into the keyhole. If the bobby pin is too thick, you can try bending it slightly so that it can fit into the keyhole. Once the bobby pin is in the keyhole, try to wiggle it around until you feel the pins inside the lock moving. If you're able to move the pins, then you should be able to turn the lock and open the door.
If the above method doesn't work, you can also try using the bobby pin to pick the lock. To do this, insert the bobby pin into the keyhole and then bend it so that the end is pointing up at a 45 degree angle. Next, use your other bobby pin to apply pressure to the first bobby pin. You should feel the pins inside the lock moving. If you're able to move the pins, then you should be able to turn the lock and open the door.
If you're still having trouble, you can always call a locksmith. They will be able to help you unlock the door without damaging it.