I believe you're referring to the giant Cyclops Polyphemus who is the proud owner of a large flock of sheep. Odysseus and his men have chanced across the land of the Cyclopes. They're feeling pretty hungry, so they're relieved to come across a cave packed to the gills with delicious food. Unfortunately, some of Odysseus's men become delicious food themselves for the angry Polyphemus when he returns from tending to his flock. This is clearly a desperate situation; every time the Cyclops comes home to his cave after a hard day's shepherding, he helps himself to a few more of Odysseus's crewmates as a snack. At this rate, there will be no one left alive.
The cunning Odysseus puts into practice a suitably cunning plan to get him and his men out of their sticky situation. He gets Polyphemus blind drunk, and when Polyphemus is sleeping off the booze, Odysseus drives a sharpened stake into his single eye. Odysseus is ready for the Cyclops when he comes home. Whenever Polyphemus returns to his cave, he always shifts the giant rock he placed at the entrance to prevent Odysseus and his men from escaping during the day.