Use proper form. Learn to do each exercise correctly. When lifting weights, move through the full range of motion in your joints. The better your form, the better your results, and the less likely you are to hurt yourself. If you're unable to maintain good form, decrease the weight or the number of repetitions. Remember that proper form matters even when you pick up and replace your weights on the weight racks.
If you're not sure whether you're doing a particular exercise correctly, ask a personal trainer or other fitness specialist for help.