I always use a shampoo like Head & Shoulders. This always gets rid of my dandruff issues. You have to really scrub it in. Dandruff is just dried skin flakes so making sure you really get in there and scrub your head is vital.
Use anti-dandruff shampoo if the problem is particularly bad. Otherwise, it should be enough to wash your hair more often with a shampoo.