Being prepared for a class is a key part of understanding the material, and getting good grades. By being prepared before the class begins, you can follow along with what the professor is saying, and pick up on little bits of information that will help you gain an even better understanding.
The first key to being prepared is to read the assigned chapters in your text books. The way that I have found works best is to first read the introduction and the conclusion to the chapter. This will give you a basic overview of what will be covered in the chapter. Next, go back and read the chapter (including rereading the introduction and conclusion). When you have finished reading, write down notes on what you just read. Then reread the chapter, filling in the blanks on your original notes. It's a bit of work, but the payoff is great. You get a better understanding of the material, and you retain the knowledge longer (which is a real plus come exam time).
The next step to preparing for class is to do your homework. Answer any assigned questions and problems whether they are collected for a grade or not. Working the problems gives you the opportunity to apply the things that were covered in the chapter. It also helps reinforce the things that you have learned.
Once you get to class it's important that you actively listen to your professor. Now is not the time to read the assignment you should have read before class, or to work on your homework. Professors have their jobs because they know the subject very well. It's their job to explain the subject to you, and to answer any questions you might have. They may bring a different perspective or point of view that will make things clearer and easier to understand.
The big thing is to do your work before class. It's been recommended that you allow 2 hours of study time for every 1 hour of class. I recommend at least that, if not more. Being prepared before class will make the time in class more beneficial, and you will leave your class session felling like you really do understand what the professor was talking about. After all, isn't that the reason your going to class?