A written warning (Abmahnung) is a formal request to stop doing something. It's similar to a cease and desist letter, a letter of demand or a mise en demeure.

Anyone can send an Abmahnung, not just the wronged party. This means you can send an Abmahnung for something that does not affect you. An Abmahnung can also ask you to pay for legal costs. If you hire a lawyer to write an Abmahnung, the letter can ask the person to pay for your legal fees. If you refuse to stop the action or to pay the fee, the person who sends the Abmahnung can take you to court.

Some law firms use this to make money. They target people who pirate movies in Germany, or websites that break minor laws1.