The most common rooms in a house to have locks on the door are the bathroom and master bedroom, and the most commonly used lock indoors is built into the doorknob. A key is not required to lock or unlock that kind of lock. Instead, either a button or knob is used to engage the lock from inside the room. If a keyless lock becomes locked without anyone in the room to unlock it, it is possible to get it unlocked from the other side of the door.
Open the locked doorknob with a screwdriver. Insert a small screwdriver into the hole in the centre of the doorknob. Use the screwdriver to feel around inside the doorknob for a small slot into which the screwdriver fits. Then twist the screwdriver clockwise. This will cause the lock to rotate into the unlocked position, and the doorknob should be unlocked.
Unlock the doorknob with a paper clip. Insert an unbent paper clip into the hole in the centre of the doorknob. Push the paper clip in until you hear a pop. Then the door should be unlocked.
Open the locked doorknob with a coin. Place a coin in the slot on the doorknob. Turn the coin clockwise to unlock the door.
Practice unlocking the door from outside the room a few times for experience in case of an emergency.