The answer to this can be found in Book 10. There, Odysseus meets Hermes, who is in disguise. Hermes does two specific things that allow Odysseus to survive the meeting with Circe.
First of all, Hermes gives Odysseus the moly plant. This plant will allow him to drink the drugged wine and to withstand Circe's other spells. Second, Hermes tells Odysseus exactly what to do after -- he tells Odysseus to threaten her and then to make sure that she swears to release his men before he is willing to sleep with her.
In The Odyssey, Odysseus suffers great personal loss and struggles constantly in his efforts to return home to Penelope. Just as he can see his home in sight, there is mutiny on his ship and his men release the winds, mistaking them for gold and silver which sets Odysseus back considerably. Unable to convince Aeolus that he should help Odysseus a second time, he travels on and, after a disastrous encounter with the Laestrygonians, Odysseus is glad to arrive at the island of Aeaea where he will rest for two days before venturing out. He will come to realize that Circe is a "cunning" goddess who has even "tamed by her enchantments," the wolves and lions that surround her. Fortunately Eurylochus, one of Odysseus's men does not fall for her charms and is able to tell Odysseus that Circe has turned his men into pigs. Odysseus, duty-bound to save his men, immediately goes to see what he can do.
Odysseus does not question the young man Hermes whom he meets on his way to Circe and is glad of his advice. " Hermes give Odysseus a herb, "a talisman (to you) against every kind of mischief." He tells Odysseus that the herb will protect him so that any spells Circe casts will not work; furthermore, Odysseus must make her swear that she will not create more "mischief," otherwise she will "unman" him whereafter he will be useless. Odysseus follows Hermes advice, fortunately and surprises Circe and she submits to his wishes. His men are returned to their human state and Circe convince Odysseus that they should all stay and recover. Odysseus will spend a long time with Circe before his men convince him to travel onward so he can eventually return home.