You can't hang a man with a wooden leg
You can't hang a man with a wooden leg,
You need a rope.
This joke is language based. The person hearing the joke will parse the setup as the following "you cannot hang a man who has a wooden (prosthetic) leg", but the punchline makes the original sentence have to be reparsed as "You cannot use a wooden leg to hang a man." The humor comes from the moment when you realized that the original sentence was ambiguous.