The humor and irony in the story emerge from the way Ichabod Crane is tricked and outwitted by Brom Bones.
The irony is that Ichabod Crane is the scholar. He is the smart one. He comes to Sleepy Hollow to be the school teacher and is well steeped in folklore, legend, and book learning. He is the one the reader might expect to outwit Brom, not vice versa.
Both Crane and Brom Bones want to marry Katrina. Brom is popular, strong, and has no pretension to higher knowledge. He loves Katrina for herself, not her property, unlike Crane.
Ironically, however, it is Brom who figures out how to best his rival and run him out of town. He knows that Crane is superstitious, so he sets up a "headless horseman" to frighten him away. When the nervous Crane sees the horseman, he believes it is a supernatural being and is frightened from the village.
Irving shows the full-blooded, practical, down-to-earth American male besting the high-strung scholar in a battle of wits. We are encouraged to laugh at the foolish Crane for being so easily deceived.