Hydroxyzine works by blocking histamine, a natural substance in the body that causes allergic reactions. It also has sedative properties, helping to calm the central nervous system, which is why it is used to treat anxiety and as a pre-surgery sedative.