die Strafe
punishment / penalty
A negative consequence that someone receives for an offense, a crime, or wrong behavior.
Für zu schnelles Fahren gibt es eine hohe Strafe.
There is a high penalty for driving too fast.

punishment / penalty
Loading your saved state.
punishment / penalty
A negative consequence that someone receives for an offense, a crime, or wrong behavior.
Für zu schnelles Fahren gibt es eine hohe Strafe.
There is a high penalty for driving too fast.

'Die Strafe' (the punishment/penalty) is the noun related to the verb 'strafen' (to punish). It describes the result of the action: when someone punishes, another person receives a punishment.
Wer die Regeln bricht, wird bestraft.
Anyone who breaks the rules will be punished.
The prepositions 'für' (for) and 'zu' (to) are often used with 'Strafe' (punishment/penalty). 'Für' gives the reason for the punishment, while 'zu' describes the type of punishment someone is sentenced to.
Er bekam eine Strafe für das Falschparken.
He received a penalty for illegal parking.
In legal and everyday contexts, there are fixed combinations. You can 'bekommen' (get), 'erhalten' (receive), or 'zahlen' (pay) a 'Strafe' (punishment/penalty). You can 'verbüßen' (serve) a prison sentence.
Er muss eine hohe Geldstrafe zahlen.
He has to pay a large fine.
In colloquial speech, 'Strafe' (punishment) is often used exaggeratedly for a very unpleasant but necessary activity. Here it is not meant literally as punishment.
Diese ganze Bürokratie ist eine echte Strafe.
All this bureaucracy is real punishment.
The expression 'zur Strafe' (as punishment) is a fixed phrase. It introduces the part of the sentence that describes the consequence of an action.
Zur Strafe musste ich mein Zimmer aufräumen.
As punishment, I had to clean up my room.
consequence / consistency
'die Strafe' and 'die Konsequenz' can both mean something negative that happens after an action. The most important difference is: a 'Strafe' is given by someone, for example by parents, teachers, a court, or an authority. It is a reaction to wrong behavior. A 'Konsequenz' is more general. It is simply a result of something; it does not have to be deliberately imposed by someone. Learners confuse the words because a punishment is often also a consequence. But not every consequence is a punishment.

Für das Fahren ohne Ticket bekommt sie eine Strafe.
She gets a penalty for traveling without a ticket.
Wenn du den Termin vergisst, ist die Konsequenz vielleicht eine lange Wartezeit.
If you forget the appointment, the consequence may be a long wait.