Answer:
In rough terms, a comedy follows a storyline where the hero, flawed as he or she may be, seems to be heading for disaster though, through felicitous or fortuitous and comic circumstances, avoids disaster; whereas in a tragedy, the hero encounters forces of fate or circumstance that are stronger than he or she is and which, in the end, bring the hero to a more or less catastrophic end.