O. Henry employs humor in "The Cop and the Anthem" through several techniques, two of which stand out:
-
By contrasting Soapy's lofty ambitions with his comically inept execution: Soapy has grand plans to get arrested to escape the cold winter, but his bumbling and ridiculous attempts at committing minor infractions serve to highlight the gap between his intentions and reality, eliciting laughter from readers.
-
By using ironic and sarcastic descriptions of Soapy's failed attempts to get arrested: The irony of Soapy performing actions — such as trying to break a window or harassing passersby — that are typically associated with serious criminal behavior, only to have them backfire or be overlooked, provides a humorous contrast to the severe consequences he is trying to provoke.
Both techniques showcase O. Henry's skillful use of language to create comedic situations and deepen the character of Soapy.