What's the mechanism of action for antihistamines in treating allergies?

What’s the mechanism of action for antihistamines in treating allergies?