At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga.
Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus.
Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
They stabbed the cyclops in the eye and tricked him into moving the boulder or something
From what I can remember, they hid under his sheep and when he went to let the sheep go outside for food they make their escape.
It's way more to it than that (like what Dbro said) but I can't really remember exactly the order in which it happens, sorry.
After Polyphemos eats a few of Odysseus' men for a meal, Odysseus goes up to Polyphemos and offers him wine to drink. Polyphemos is pleased with the wine and asks Odysseus what his name is, (this is because Polyphemos says that he will eat Odysseus last). Odysseus introduces himself as "No Man". The cyclops has too much to drink and when he is drunk, he falls asleep. At this point, Odysseus takes the sharpened green olive pole that he and his men prepared earlier, and heats it up in a fire. Then, Odysseus and his men stab the spear into the Polyphemos, blinding him. When the Cyclops calls for help, his brothers yell back and ask him who is hurting him. Polyphemus replies "no man." This causes the other Cyclops' to think that he is joking around and so they leave. Cyclops removes the boulder from the door so he can catch anyone trying to escape. To get past Polyphemus, Odysseus tied the male sheep into groups of 3. They then wait until dawn. At dawn, Odysseus had each of his men to be underneath a middle sheep in a group of 3. Odysseus hides under the largest ram. When the Cyclops touches around to find the men, the only thing he feels are sheep and so he does not become suspicious.
Polyphemus was blinded by Odysseus and he and his men escaped by hiding beneath the sheep as the cyclops took them out of the cave to feed .