Odysseus faced a number of obstacles on his way home from the Trojan War that Poseidon, god of the sea, placed in his way. After the end of the war, Odysseus was standing on a cliff, overlooking the sea, praising himself for his cunning in fooling the Trojans with the wooden horse that contained Greek soldiers. Poseidon heard him and was angry at Odysseus' arrogance.
The reason for Poseidon's anger was that it was the sea serpent eating the sons of the Trojan priest Laocoon that convinced the Trojans to take the horse inside their walls; before the serpent appeared, they were prepared to destroy it. Odysseus did not recognize this when he praised his own ingenuity.
As Odysseus left Troy, his ship was hit by storms at every turn, as Poseidon was determined to keep him from getting home. He ended up on the island of Circe and had to go to Hades to consult Tiresias, the blind prophet, as to the best way to get home. He also landed on the island of the Cyclops Polyphemus, also Poseidon's son. When Odysseus blinded the Cyclops, Poseidon's rage was further increased. Finally shipwrecked on the island of Calypso, Odysseus built a raft and ended up floating to the land of the Phaeacians. Ironically, Poseidon was the patron of these seafarers, but they ended up giving Odysseus a safe journey home, where he faced the final challenge of fighting off the suitors who had been trying to woo his wife for the decades he had been gone.