First of all, the best way is to prepared well in advance of the test. That means you really have to pay attention in class and take notes. If you don't get something that the teacher just said, ask a question.
Second, always do the homework. The homework makes all that new knowledge stick and...