If you wish to lock a door but don't have an actual lock, you can improvise by finding an item that will properly wedge the door shut. Chairs are commonly used to accomplish this task because they are sturdy and do a good job of holding the door shut even if it is being pushed hard. The technique is simple enough if you know how to wedge the chair beneath the door properly.
Place the back of chair against the door that you wish to lock. You will need to do this on the side that the door opens into, not away from.
Prop the chair so the top of the chair's back is in between the door knob and the door itself. The two back legs of the chair that are closest to the door should not be touching the ground.
Scoot the front legs of the chair as far back as possible toward the door to wedge the chair into place.