Disclaimer: If you meet a medium-sized arboreal lizard in nature, you probably shouldn't disturb him. Just let him be, and the encounter will be more pleasant to both of you.
That said, this little guide to lizard handling is meant for terrarium owners who keep a medium-sized arboreal lizard. Examples of medium-sized arboreal lizards are water dragons, sailfin lizards, crested basilisks and juvenile green iguanas (an adult iguana would be a large arboreal lizard). There are a few variations depending on species (notably, most crested basilisks hate being handled, and some will put up a quite vicious fight -- be warned, when fully grown, these creatures can cause quite a lot of damage to your fingers), so these are generic instructions.
First, approach the lizard carefully. Most lizards are very alert, and will quickly spot you and then carefully watch what you are doing. In nature, all lizards except the Komodo dragon have a number of natural predators to watch out for, so they have many finely developed defensive instincts, are quick runners, have defensive natural weapons, and acute senses. Most of them react instinctively to a sudden movement, so you should try to move as without any sudden jerks. Also you'll want the surroundings to be relatively quiet if the lizard isn't used to you.
Interpret lizard language right
When you move your hands closer to the lizard, you should be aware of one other interesting fact. Most of the predators that attack arboreal lizards are birds, which means that a swooping movement from above will almost certainly make the lizard try to flee, or react with a swift counterattack. You don't want that. Keep your hand where the lizard can see it, and move it in at around ground level or just over the lizard. As you move your hands closer to the lizard, she may puff herself up a little and look "hostile". If she hasn't been mistreated, and is a member of one of the more common pet species (the water dragon and the iguana), this is usually just a me-big-mean-lizard show, to kindly inform you whose turf you've just stepped into -- almost all lizards are territorial to some extent. If she means business about not being picked up right now, she will open her mouth and perhaps even hiss. If your lizard seems especially hostile (mouth-opening, hissing), you should perhaps reconsider, if it isn't urgent. You don't want to be abusive to the animal, and reptiles don't really understand the concept of you being the "boss", like a dog would. Water dragons and iguanas rarely bite, but they do have very sharp teeth as well as whipping tails, so you should always be careful. Captive-bred lizards are usually unlikely to actually use any of those (whereas a wild-caught or poorly treated lizard will counterattack), but as said, you don't want to cause discomfort to your lizard.
How to pick the lizard up
If the lizard only does a slight puff (or, if she's used to being handled and understands you aren't trying to take over her territory, nothing at all), it should be safe to try to pick her up. It is important to be polite about this and to make sure you cause no discomfort to the lizard, or she will never learn to trust you. Where to take hold? With all lizards, there is one important rule of thumb here: Never, EVER, pick a lizard up by its tail. By doing so, the tail may break off to allow the lizard to escape (this phenomenon is known as caudal autotomy). Part of it will regenerate, but contrary to popular belief, this is not an actual "new tail", it is a poor substitute. It will also cause the lizard pain, and bleeding. Also, you can be pretty sure that you will be activating any defense and escape instincts the lizard has. It's important to remember a little about lizard psychology here: While lizards do appear to possess a crude "intellect" (some are clearly able of learning and of forming semi-complex associations -- the Australian bearded dragon can tell humans apart, and react favourably towards humans that have treated them well in the past), they are also highly instinct-driven animals, and if you want to have a nice relationship with your reptilian companion, you'll want to avoid sending her into a purely instinct-driven mode or she'll never learn to trust you. The second rule of thumb: Don't grasp too tightly. You don't want to cause organ damage to your lizard. With most medium-sized arboreal lizards, the best way to do it is to use two hands, getting the fingers under her belly (between the forelegs and the hind legs) and thumbs above her back. If she isn't used to being handled (or doesn't want to be handled right now, for example because she is itching all over from shedding skin), she will swish and undulate her body, struggling to get free. A lizard doing this can be close impossible to hold on to; the best thing to do is to use your other hand to get in front of the first one in case the lizard gets out. Most lizards quickly calm down, when they realize that they haven't been eaten or harmed. Always make sure to support the lizard's legs and tail, this is a much more comfortable position for the lizard than having her limbs unsupported.
Beware of Claws
When the lizard is calm, you should allow her to assume a comfortable position. Usually, this means she will place her "hands" on the edge of your hand, and place her feet on your palm, wrist or arm, depending on the size of the lizard. Be aware that all arboreal lizards have sharp claws, and that your lizard will use her claws to get a good hold on you. If you aren't wearing long sleeves, you should be prepared for twenty tiny claws pricking your skin, and make sure you don't react with a shocked jerk when the lizard grabs hold. She isn't being hostile or mean, she is simply doing the only thing she can to make sure she doesn't fall off, and by all rights you should be happy that she trusts you enough to do so. Most arboreal lizards will climb to a comfortable spot on your lower arm (which reminds the lizard of a thick branch, which she knows how to deal with). Some lizards can have their claws trimmed (iguanas and water dragons both can), although you must be VERY careful when doing this, all lizards have veins running through their claws, and obviously cutting a vein will be painful for the animal (and possibly you, if she gets angry)
If the lizard becomes a long-time acquaintance of yours, you can be sure that any hostile or fearful behaviour will decrease over time, as the animal realizes that you won't harm her. Some lizards (notably water dragons, iguanas, and the non-arboreal bearded dragon and blue-tongue skink) will practically end up handling themselves, happily walking into your hands or jumping onto your arm or shoulder. You can help your lizard realize that you're a friend by stimulating the lizard's associative intelligence: When the lizard is in your hands, feed her a treat (wax worms are good for insectivores like the water dragon, herbivores like the iguana have quite the sweet tooth making fruit a good treat), or pick her up before she's gotten nice and warm and let her soak up your body heat (I've found the last possibility a great method for reptile/mammal bonding). If you make sure the lizard experiences good things when she's with you, she will eventually realize that you are the source of good things, which will make most lizards turn into quite friendly, trusting and even playful creatures. The important thing is to remember that your lizard has some boundaries you don't overstep; always treat her with the respect she deserves.
Congratulations! You now know how to handle a medium-sized arboreal lizard with a minimum of discomfort to both of you.