Keep in mind that usually the point of an exam, particularly in higher levels, is to test whether you understand the material covered in the course enough to apply it in new, previously unknown situations.
That being said, you have to learn what works best for you and that best way I know for a person to do that is unfortunately trial and error.
What I've found that works for me:
1. Sleep. Eat healthy. Exercise. Study. Work on doing all of them well.
2. Avoid cramming and be systematic and disciplined about your studying.
3. Leave some time for review of material that you've already been tested on.
4. Once you've reviewed the material covered in a course, try to predict the kinds of questions that your professor may ask. You won't always get it right, but this helps you to think of the material in new ways.
5. Read the entire exam first. Make sure you understand what's being asked for in each question and focus on giving the best answer you can. Answer the questions you know the answers to first.
6. Show your work.
7. When you don't know the answer, start by working out what you do know and try to figure out what your specific stumbling block is.