It's almost an art... Lol... Nah, kidding.
First things first, you MUST bring your camera to test it. Also bring a small torchlight.
When you see the lens, don't be too excited and mount the lens. Check its physical conditions first. Look for major knocks, dings, scratches, peeling paint, flaking rubber etc. Also check both front and rear glass elements under the torchlight to make sure there are not scratches or fungus (i.e. mould).
If the external condition is satisfactory, mount the lens on your camera. Make sure the lens is in AF and the Stabilizer is OFF. Select the center AF point only. Randomly focus on very far, then very near objects. Listen for any weird sounds. The ultrasonic AF motor in Canon lens should be very quiet, with only a very soft hiss. Now zoom in on something and half-press the shutter. Take note how shaky your hands are. Next switch the Stabilizer ON and zoom in on the same thing again, half pressing the shutter. The stabilizer should turn on, so listen for loud sounds. The image in your viewfinder should be more stable than just now since now you get help from the stabilizer. Next take a picture of a well-lit subject a medium distance away (but not a light source) using AF and stabilizer ON. Now take a picture of the same thing using MF (manually focus) and stabilizer ON. Compare the two pictures: they should be focusing on exactly the same thing and look exactly the same
If any of the above tests fail, move on.