The preposition gegen is usually translated as "against" in English, but there are some exceptions, especially when gegen comes up in a health context. When discussing whether a medicine is effective for a specific health condition, gegen is usually translated as "for":
Gegen die Halsschmerzen hilft ein Hustenbonbon.
For sore throats, a cough drop helps.
Caption 9, Krank sein - mit Eva
Play Caption
Das kann ganz gut gegen das Bauchweh helfen.
This can help a lot for a stomachache.
Caption 17, Krank sein - mit Eva
Play Caption
However, gegen in regards to allergies is usually translated as "to":
Ich bin erst mal allergisch gegen Pferde geworden...
I first became allergic to horses...
Caption 44, Curly Horses - Pferdeglück auch für Allergiker
Play Caption
One exception, however, is regarding immunization, where gegen is usually translated as "against":
Bist du eigentlich gegen die Schweinegrippe geimpft?
Are you actually immunized against the swine flu?
Caption 24, Deutsche Musik - Thomas Godoj
Play Caption
Further Learning
Do a search for gegen on Yabla German and see some more examples of how this preposition is used in German in a real world context!