John Allen Paulos in his Who's Counting column at ABC News:
To obtain a fair result from a biased coin, the mathematician John von Neumann devised the following trick. He advised the two parties involved to flip the coin twice. If it comes up heads both times or tails both times, they are to flip the coin two more times.
If it comes up H-T, the first party will be declared the winner, while if it comes up T-H, the second party is declared the winner. The probabilities of both these latter events (H-T and T-H) are the same because the coin flips are independent even if the coin is biased.
For example, if the coin lands heads 70 percent of the time and tails 30 percent of the time, an H-T sequence has probability .7 x .3 = .21 while a T-H sequence has probability .3 x .7 = .21. So 21 percent of the time the first party wins, 21 percent of the time the second party wins, and the other 58 percent of the time when H-H or T-T comes up, the coin is flipped two more times.
More here.