In trying to determine which plays are comedies and which tragedies from a list, you are being asked to evaluate what is known as "genre", a way that literary critics group works by similarities of style and theme.
Classical drama was divided into two major genres, tragedy and comedy. The definitions of these genres in Aristotle's Poetics have been enormously influential on subsequent criticism. Comedy, according to Aristotle, is a form that criticizes people who are worse than average or in some way despicable (misers, adulterers, cuckolds, etc.) and tragedy has a theme of a certain seriousness and shows people greater than average (heroes, kings, queens) who often are caught up in circumstances or have character flaws leading to their downfall. comedies are funny and light, often with romantic plots, and usually have happy endings and tragedies are serious, filled with a certain grandeur, and usually end unhappily. Among Shakespeare's plays, for example, King Lear, Romeo and Juliet, and Hamlet are tragedies and Twelfth Night, A Midsummer Night's Dream, and Much Ado About Nothing are comedies.