I've found that the most important thing in preparing for a test is to PLAN AHEAD. Don't wait until the last minute to cram! I always find that I want to be DONE preparing two days before the test, e.g., if the test is on Wednesday, I'm fully prepared for the test by Monday. This means, I start studying at least the week before (or for final exams two or three weeks before).
How you study also depends on the type of test. For math or physics tests, I find that practicing as many problems as possible is helpful--go through all of the homeworks you've done, re-do the problems, understand why you get them right or wrong, and try other practice problems if you can find more. For science, history, english, or social studies tests where there's a lot of memorization, I find that re-writing and re-organizing my notes is very helpful for getting the knowledge down.
Finally, when you're doing the studying, make sure you're in a good environment where you will not have distractions and where you have enough space and light, e.g, the library. When you're studying don't get distracted, but take breaks. For example, I always tell myself that I'm going to work for 30min then take a 5min break. This means I do nothing but studying for those 30min (no visiting facebook or youtube or checking for texts from friends), then I reward myself with a 5min break, and then start again.
Studying TAKES TIME. Plan ahead so you give yourself enough time. And focus on studying in the time you've allocated for studying.