What occurs when a character word mean the opposite of their literal meaning?

When a character word means the opposite of its literal meaning, it is called irony. Irony can be used to add depth to a character's personality, create humor, or convey a larger message. This literary device can create an interesting dynamic between what is said and what is actually meant, leading to a richer reading experience for the audience.