There are two different ways to answer this question. Right from the beginning of the poem, there is an ominous sense that things are not quite right. As the play progresses there is a feeling that Oedipus is the main culprit. The characters of the play are able to see the truth more and more. Jocasta even tells Oedipus not to push forward. She knows the truth. Oedipus is blind the whole time. So, he needs to see in a different way.
Oedipus comes to the truth in a more analytical way. He needs to find out the hard way, we can say. The one tasked to expose Oedipus as a child finally comes to Oedipus and Jocasta. He confesses that he did not have the heart to kill the baby and that this baby grew up in another city and that this baby is, indeed, Oedipus. Through this moment of clarity, the truth is exposed, even to Oedipus. All know that Oedipus killed his father and married his mother.