Describe the symptom using familiar person forms. Ask whether the pharmacy has something to help, or state your need with Ich brauche. These questions and statements reuse your prepared word order; focus on etwas and the complaint introduced by gegen.
Kopfschmerzen means a headache; the German noun is plural. Use haben plus the symptom to describe how someone feels, rather than owning an object. Reuse the known person form ich habe and put bare Kopfschmerzen after it, without an article. The symptom phrase stays separate when the person changes: formal Sie haben Kopfschmerzen addresses one adult or several.
etwas means something. gegen means for or against (a symptom) and takes the accusative. Put them together as etwas gegen Kopfschmerzen. Ask the pharmacist with Haben Sie etwas gegen ...? or state what you need with Ich brauche etwas gegen ....
Bauchschmerzen means pain in the stomach or belly. Like Kopfschmerzen, it is plural and has no article after haben: Ich habe Bauchschmerzen. Change the symptom while keeping the known person form. Use formal Sie haben Bauchschmerzen when repeating an adult's report back to them; the verb form agrees with the person, not the plural symptom noun.