When the beans come to the boil, cook for 5 minutes, then drain the water and discard.
Pour clean water again, preferably hot, and bring to a boil.
When they come to the boil once more, drain and throw the water. It would be good to repeat this procedure 2-3 times so that you avoid having any consuming beans problems :)