For less urgent cases of illness, please contact a general practitioner ("Allgemeinarzt") first. They are also called "family doctor" ("Hausarzt"). They will either treat you directly and may give you a prescription for medicine or supporting treatment measures, or they will refer you to a specialist for further examination (e. g. dermatologist, gynaecologist etc.).
Should you need a general practitioner outside the regular consultation hours, i. e. in the evenings, on the weekend, or on holidays, you can call the emergency medical services ("ärztlicher Bereitschaftsdienst"). The number is: 116 117.
In Germany, prescription drugs and medicine are available almost exclusively in pharmacies. Pharmacies are marked with a big, red "A" for "Apotheke". Should you need medicine outside the regular opening hours, there is a pharmacy emergency service. To find out which pharmacy near you is on emergency duty, check the internet or the notice that you will find at every pharmacy.
Please note that many drugs (e. g. antibiotics) are available only on prescription. Except for a small co-payment, the costs for prescription drugs will be covered by your health insurance. Over the counter medication, such as mild painkillers, can be obtained without a prescription, and at your own expense.