A locking doorknob, or lockset, on your bedroom door is properly called a privacy lockset. This means that you can lock the door from inside the room and, in most cases, you cannot unlock it with a key from the other side of the door, as you can with an entry lockset. So what do you do if you accidentally lock yourself out of your bedroom—or your kid locks the door not-so-accidentally? Usually, there's a simple solution, and this depends on the type of door lock you have.
Unlocking a Bedroom Doorknob With a Push-Button Lock
Privacy locksets with push-button locks have a little pinhole in the center of the knob on the non-locking (exterior) side of the door. Directly behind the pinhole is a release button inside the knob. You can unlock the door by sticking a straightened paper clip or similarly sized wire (or even a very small screwdriver) into the hole and pushing the release button, which pops out the lock button and unlocks the door. Some doorknobs with push-button locks come with a pin-like key just for this purpose (if only you can find it).
The trick to this method is to push the wire straight back (horizontally) from the pinhole. The release button is small in diameter and is in the exact center of the doorknob. If you angle the wire at all, you'll probably miss the button. If at first you don't succeed, try, try again.
Unlocking a Bedroom Doorknob With a Turn-Button Lock
Turn-button locks are the familiar type that you turn with your thumb and forefinger. Like push-button locksets, these also have a pinhole on the non-locking side of the door, but usually, turn-button locks have a somewhat bigger hole. This is to accommodate an emergency key, which comes with the doorknob. So the first thing to look for is the emergency key. Check along the door trim above the bedroom door. (Alternatively, if you have a picture on a wall near the outside of the door, you can hide the key behind the picture).
Emergency keys have a flat tip much like a flat-head screwdriver. And if you can't find the official key for your door, guess what you can use—you just need a very skinny screwdriver that will fit through the pinhole in the doorknob. A "tech" or "precision" flat-head screwdriver usually works, as does a long eyeglass screwdriver. Barring that, a stiff, flat wire can also do the trick.
To unlock the door, simply insert the key or other tool into the pinhole in the doorknob, and push it straight in until you contact the release button. Rotate the key until it fits into the slot in the button, then turn the key, just like turning a screw. Turning clockwise usually unlocks the lock, but if that doesn't work, turn it counterclockwise.
Unlocking a Bedroom Door By Removing the Doorknob
If your locked doorknob has no pinhole for releasing the lock, you may need to deploy the nuclear option: removing the exterior knob, and possibly both knobs. If there are screws on the escutcheon plate (the decorative ring against the door) on the exterior side, remove the screws, and slide the exterior knob away from the door. Poke around inside the lockset with a flat-head screwdriver to see if you can release the lock or pull back the door latch. You can also try to push the interior doorknob out of the door to gain better access to the latch.
If the exterior knob has no screws, look for a small metal tab on the doorknob's post, along the edge of the escutcheon plate. Depress the tab (it's spring-loaded) with a small flat-head screwdriver to release the doorknob, then pull off the knob. Use the screwdriver to pry off the escutcheon and gain access to the lockset interior.