Visa on arrival: At Damascus and Aleppo airports you can get the visa directly on entry. You pay the fee there in cash, usually in US dollars. So have suitable notes ready. At land borders, a visa on arrival is not always possible.
Visa via the embassy: You can also apply for the visa before your trip at the Syrian embassy in Berlin. Allow enough time for this.
Entry rules in Syria are changing often at the moment. Sometimes prior entry approval is needed. So before every trip, ask the Syrian embassy or your airline which option applies to you. You can also find current information in the travel and safety advice of the German Federal Foreign Office.