In an effective drama, whether comedy or tragedy, the protagonist is going to have something wrong with him.
This is his flaw—or, if you want to use the fancy Greek word, hamartia.
Comedy vs. Tragedy
If it’s a tragedy, it’s his tragic flaw. If it’s a comedy, then I suppose it’s just the, um, regular kind of flaw.
And, in fact, whether or not your drama is a comedy or tragedy is wholly dependent on the protagonist’s overcoming of his flaw.
If the protagonist does overcome his flaw, the drama should be a comedy. This is the fiction-logical reason that the protagonist is able to triumph in the climax.
If the protagonist does not overcome his flaw, the drama should be a tragedy. This is the fiction-logical reason that the protagonist is not able to triumph in the climax.
The Nadir
In either case, whether comedy or tragedy, the protagonist cannot overcome his flaw until it has taken him to his lowest point: the nadir. This usually occurs toward the middle of a work.
For instance: I went to see Harry Potter 7 (part 1) last night. Since it’s a two-parter, it follows that the end of the first movie is the middle of the work. And guess what: it was a total downer. It ended at the lowest point. Things seemed hopeless. Voldemort’s got all his junk in order, and people are dying left and right.
Now, it’s not a pure example (since all this badness is not a direct result of Harry’s flaw), but the structural element is still obviously present.
Now, if the drama is a tragedy, the protagonist will (a) not recognize that the nadir is sourced in his flaw or (b) will realize but be unable/unwilling to overcome his flaw. He will continue toward his goal with his flawed approach and heap even more devastation upon himself in the end.
However, if the drama is a comedy, the protagonist will realize his flaw as the source of his grief and will work to overcome it. He will overcome it in the climax and will, in the denouement, beat down whatever comes at him—because he overcame his flaw.