They escape by blinding Polyphemus the cyclops by poking his eye with a stick so when the cyclops went to take his sheep out the men tied themselves to the sheep so Polyphemus couldn't feel them and when the sheep were out they untied themselves and sailed away.
Hope this helps!