The ancient Greeks tended to hold a very pessimistic vision of the universe, by which individual human beings held very little agency to shape their own destinies. Prophecy is a powerful motif in Greek myth and storytelling, and in some traditions, even the gods were largely powerless to overturn the dictates of fate.
This same theme of fate is central to the myth of Oedipus. In the story, Oedipus is fated to kill his father and marry his mother, and there are ultimately two attempts to circumvent it. The first attempt lies with his biological parents, who, aware that their son was fated to kill his father, abandon Oedipus outside the city, intending that he die of exposure. However, Oedipus is rescued from this fate and raised by Corinth's king and queen.
Later, Oedipus consults the Oracle of Delphi, who reveals to him that he is destined to kill his father and marry his mother. Revolted by this fate, Oedipus departs, intending to never return to the parents who raised him. As he travels to Thebes, Oedipus gets into a confrontation with a stranger on the road, and, driven into a rage, he kills him. This stranger turns out to be his biological father. Later, in Thebes, Oedipus will defeat the Sphinx and be awarded with kingship, marrying his biological mother, Jocasta, the queen.
Ultimately, then, in the myth of Oedipus, it is these attempts to circumvent fate that lead to its fulfillment. In the Greek mindset, the lesson would have been one of futility: Oedipus could not change his fate, and the same could be said of any other human. Destiny is too powerful a force for human beings to overcome. In the end, all they can do is accept the fates they have been given.