the first thing to do is to make sure you're not in some kind of advance super-athlete class. choose ones that are close to your level.
if you're just getting started, talk to the instructor and see if there's a way to modify the movement, or some kind of movement you can do if it all gets to be too much. stopping is usually the single worst thing you can do.
and if the instructor is unhelpful, ditch the class. good instructors are compassionate and knowledgeable and are there to you help you succeed.
pacing yourself is hard until you understand what a whole class is going to feel like, so you have to keep going to figure it out
try not to beat yourself up, and try a bunch of different kinds of classes if you can.
and remember - the more you go, the better you feel. you won;t get any better if you just stop going!
isolde