That depends on how it is locked. If it is a regular key lock, it can most likely be picked with a hairpin ir nail file. If it is loced with a deadbolt, you may need to take the hinges off the door. Otherwise, removing the doornknob might be an option as well.
Some doorknobs have small holes in the front, instead of a key, put a small object, such as a nail, in and you should hit a little spring. Keep pushing and turn the knob and it will open.
If it's an interior door knob with just the hole in the center, you can use a paperclip to stick in the hole and unlock the door. If the door knob has a key you can try using a credit card or piece of thin metal to block the lock.