+1 on finding a good instructor. I'd avoid yoga classes at gyms, at least at first (there can be great teachers there, but it's hit or miss), and concentrate on yoga studios. Many studios post their instructors bios online, and a good instructor usually will have good training listed in their bio.

I personally would not take a class with a instructor with less than 200 hours of training at a reputable school (unless, of course, they've mentored with a master). A good school will teach contraindications for certain injuries, and a good instructor will be sure to tell you "if it hurts, don't do it". I always tell my students that if something hurts and they're unsure what to do, they should come out of the pose and raise their hand, and I'll come over and give them modifications for the pose, or another pose altogether. Also, you should be able to rest when you want to. If your instructor acts like a drill sargeant, get out of there! And I recommend avoiding instructors that practice with the class. Demoing a pose is perfectly acceptable (and often a good idea), but if an instructor is doing the practice with you then they're not watching out for you.