Both are nouns that refer to the idea of saying one thing but meaning the opposite.
Their adjective forms are SARCASTIC and IRONIC.
SARCASM refers only to what a person says. IRONY refers to both what a person says and also to situations where opposite meanings.
Examples: SARCASM: 1. "That was a smart thing to do!" (meaning it was a stupid thing to do).
2. "You really know how to make a guy feel good." A man might say this after the guy's girlfriend breaks up with him, He means exactly the opposite of what he said.
IRONY: 1. When a teacher who is teaching the present perfect tense uses it incorrectly, that's a good example of irony.
2. An overweight nutritionist is also a good example of irony.
3. When Donald Trump tells people how to avoid bankruptcy, that's an example of irony because he's filed for bankruptcy four times so far in his life.