Some doorknob designs and configurations are more practical than others. Just ask anyone who has ever found himself accidentally locked out of a pantry or bedroom with no practical way to open the lock from the outside. Fortunately, normal household bedroom locks are not difficult to penetrate and you should be able to get back into your locked room with a bit of patience and the use of some basic household items.
Plastic Card Method
Grasp the doorknob firmly in your non-dominant hand -- if you are right-handed, hold it with your left hand.
Push the door so that the gap between the doorframe and the locked door is as wide as possible.
Insert your plastic card into the gap above the doorknob at a slightly downward angle.
Gently wiggle the plastic card downward until you encounter the locking mechanism of the doorknob. In your mind, picture the metal piece that protrudes from the door into the doorjamb. It is angled at the end.
Slide the plastic card against the angled portion of the metal locking mechanism and push it back out of the doorjamb by applying leverage from the portion of the plastic card that you are holding.
Push open the door when you feel the resistance from the lock start to give. You may have to wiggle the card and doorknob to get the right opening and it may take several tries.
Doorknob Removal Method
Manually remove the doorknob if you can not get the door to pop open using the plastic card.
Locate the screws on either side of the doorknob. These are actually holding the doorknob together through the door.
Use your screwdriver to remove them and then manually pull the locking mechanism back into the door to open the room and unlock the door.
Determine if the door swings toward or away from you. If the door swings toward you, you can remove the door from the hinges.
Use a razor blade or box knife to slice around any paint that might be holding the hinge pins to the hinges.
Place the tip of the screwdriver directly under the lower hinge pin at an angle.
Tap against the screwdriver hard enough with the hammer, regaining leverage each time, to slowly push the hinge pin up and out of the hinge.
Repeat with upper door hinge, being careful to make sure the door does not fall off the hinges and on top of anyone.