Attend class consistently. You'd be surprised how much harm missing a couple of days can do. Professors teach what they're going to test you on, so its best to attend each and every session. They may skip over parts of the book, or emphasize material that you should know.
Pay attention. Just sitting in class isn't going to get you a good grade. Try to focus on what the professor is saying, and if something isn't clear, ask questions. If you'd rather not interrupt, stay after class and talk to the instructor.
Participate. Many classes include a discussion and teachers will grade you on class participation. This means that you have to share your viewpoint and discuss various issues. Most professors appreciate students who take an active interest in learning and make class lively.
Study consistently. No matter how tempting it is to sleep in and party the weekend before the test, you must study. Space your study sessions out so that each one is no more than an hour or two each day over several weeks. One cram session the night before the test panics rather than prepares.