Locate the two mounting screws located on one side of the door knob/lock assembly. If you cannot see the mounting screws, the door likely has a cover plate. Use a slotted screwdriver to pry the cover plate off to expose the screws. Some door knobs require you to remove the knob itself with an Allen key in order to access the screws.
Remove the two mounting screws with a Phillips screwdriver and pull both halves of the doorknob assembly apart.
Switch the two halves of the doorknob assembly so the locking knob is on the inside of the room. Slide the two pieces back into the door.
Use the Phillips screwdriver to tighten the two mounting screws back into place. Check the door to ensure it can now lock correctly from the inside.