According to the myth, towards the end of the war, Odysseus crafted a plan in order to take over the city of Troy. So, the Greeks built a large wooden horse, the so-called Trojan horse, and then embarked on their ships and presumably set sail back to their homes. Sinon pretended to have been abandoned by his fellow soldiers and have deserted the Greek army; when he was caught by the Trojans, he attributed this to the rivalry between himself and Odysseus. He then proceeded to say that the Trojan horse had been built by the Greeks as a gift to the gods in order to ensure their safe return home. He also convinced the Trojans that the reason it was so big was to make sure that the Trojans would not be able to carry it into the city, which would protect Troy from any future Achaean invasion.
The Trojans were eager to bring the horse within the city walls, excited by Sinon's words. Cassandra, a Trojan prophetess who was cursed by Apollo to not be believed by anyone, warned her compatriots against this decision. Laocoon also said not to move it into the city, but two snakes appeared and strangled him and his sons; the Trojans saw this as punishment from the gods, and immediately moved the horse into the city.
What Sinon had not told his captors, though, was that the Trojan horse was hollow inside, hiding the best of the Greek soldiers. So, when the night fell and the Trojans were drunk after the festivities for driving away the Greeks, the Greek soldiers came out of the horse and started killing their enemies. Sinon immediately informed the rest of the Greek army that was waiting outside the city gates and they all attacked.