In a pharmacy you can get medicine and medical products. For some medications you need a prescription from a doctor so you can buy them in the pharmacy. Other medications you can get without a prescription (the doctor or the pharmacist can help with that).
If you are an asylum seeker you need an health insurance voucher from the „Amt für Zuwanderung und Integration“ (Office for Immigration and Integration), with this voucher you can go to a doctor. The doctor will write a prescription, with this you can go to the pharmacy and get the medications.
If you have a residence permit you can go to the doctor with your health insurance card. The doctor will write a prescription that you can take to the pharmacy.
Cosmetical products also can be bought in the pharmacy. These you can get without a prescription and you have to pay them yourself.
[caption id="" align="alignnone" width="2000"] prescription, photo WIkipedia[/caption]