A tragic flaw, as its name suggests, is a negative character trait that ultimately leads to a character's downfall. Shakespeare implements tragic flaws in many of his tragedies (Macbeth's ambition, Othello's jealousy, Lear's naivety), and Hamlet is no exception.
Famously, Hamlet's tragic flaw is his hesitancy to act. He is full of indecision throughout the play, as is evidenced in the "To be or not to be" speech. Often, Hamlet uses various excuses to hide his hesitancy. Take this moment for example, when Hamlet is given the chance to kill Claudius but eventually decides not to:
Now might I do it pat. Now he is a-praying.
And now I’ll do ’t. And so he goes to heaven.
And so am I revenged.—That would be scanned.
A villain kills my father, and, for that,
I, his sole son, do this same villain send
Oh, this is hire and salary, not revenge.
He took my father grossly, full of bread,
With all his crimes broad blown, as flush as May.
And how his audit stands who knows save heaven? (3.3.74–83)
Here, Hamlet is saying that he does not want to kill Claudius because he would be sent to heaven, having just prayed away his sins. Hamlet suggests that this would be doing Claudius a favor and thus decides against it. While many critics have taken Hamlet at his word, I think we should at least be suspicious of his decision in this moment. Perhaps Hamlet is telling the truth, but it seems to me that it is more delaying. Does Hamlet even believe in praying sins away? Throughout the play, he seems to express rather atheistic views and never mentions Christianity except in this moment.
Ultimately, Hamlet is destroyed by his tragic flaw, though it is possible that he would have been destroyed without it as well. Should Hamlet have chosen to kill Claudius in this moment, it is unlikely that things would have gone much better for him. However, other lives may have been saved, and perhaps their deaths are the true consequence of Hamlet's flaw.