Quick answer
Medicine “against” a complaint uses от + genitive: от головы́, от ка́шля, от го́рла. Literally “from the head”.
The place
What you ask for
What is wrong
At the counter
От + genitive
The pattern is fixed and oddly logical: the medicine takes you *away from* the problem. От головы́ is not “for the head” but “from the head” — and что́-нибудь от plus a body part will always be understood.
Good to know
Russian pharmacies sell many things over the counter that need a prescription elsewhere, and the pharmacist will advise you directly. Generic equivalents are usual and much cheaper: ask Есть анало́г подеше́вле?. Many city pharmacies are круглосу́точно — open around the clock.
Typical mistakes
что́-нибудь для головы́
что́-нибудь от головы́
Medicine takes от, not для.
мой мазь
моя́ мазь
мазь ends in -ь and is feminine.
Check yourself
Which preposition do you use for medicine?