Sarcasm is when someone says something, but means something else. They mean either the opposite of what they said, or that they disagree with what they just said.
Sarcasm is different from lying because when a person is being sarcastic, the person listening is supposed to understand that the person speaking does not mean what they just said. If someone says something sarcastic, it is usually said in a tone of voice that tells the person listening that they are being sarcastic. Perhaps the person listening knows the person talking well enough to understand that the person talking is being sarcastic.
Sarcasm can be used to criticize someone. It can be unkind.
Sarcasm can also be used to be funny. If the person's tone of voice is normal when they say something sarcastic, this is called "deadpan" or "dry humor".