Step 1: Attach the cord to the door handle
First, cut a length of cord aproximately 12"long and fold it in half, then tie a knot at the folded end, leaving a loop just big enough to fit the end of the door handle through. Place this over the handle with the knot at the bottom, then pull the two loose ends up over the little lumps on the end of the handle and tuck them under the top of the loop. put them back through the loop and pull upwards then the cord should be attached to the end of the handle.
If you are using a hook and a ring (inside lock only), tie the ring to the two bits of cord hanging off the top, otherwise, just tie a big knot that you can attach the second piece of cord (from the top of the door to)
Step 2: From the inside
For a more durable lock, a hook can be made from a large paperclip so that it fits over the door instead of using a knot. this may leave a dent so you can put a thick piece of card under it to prevent any damage.
Step 3: From the outside
To unlock the door, remove the lock, allowing the knot to be untied to the handle can be turned.