das Pech
bad luck
Misfortune or an unlucky coincidence; the opposite of luck.
Wir hatten wirklich Pech mit dem Wetter im Urlaub, es hat nur geregnet.
We had really bad luck with the weather on vacation; it did nothing but rain.

bad luck / pitch
Loading your saved state.
bad luck
Misfortune or an unlucky coincidence; the opposite of luck.
Wir hatten wirklich Pech mit dem Wetter im Urlaub, es hat nur geregnet.
We had really bad luck with the weather on vacation; it did nothing but rain.

You can easily recognize the meaning of 'Pech' (bad luck / pitch) from context. If people are talking about luck or mishaps, it means 'Unglück' (misfortune). If the topic is materials, construction, or history, it means the sticky substance.
Zuerst den Zug verpasst und dann den Schlüssel verloren – was für ein Pech!
First missed the train and then lost the key — what bad luck!
The most common use is the fixed expression 'Pech haben' (to have bad luck). The exclamation 'Pech gehabt!' expresses that someone has to accept an unfortunate situation.
Er hat im Lotto nie gewonnen, er hat einfach immer Pech.
He has never won the lottery; he simply always has bad luck.
In the meaning 'Unglück' (misfortune), 'Pech' is an uncountable noun. It is therefore used without an article when speaking generally about it, for example in the expression 'Pech haben' (to have bad luck).
Ich wünsche dir viel Glück und kein Pech bei der Prüfung.
I wish you lots of luck and no bad luck on the exam.
The idiom 'wie Pech und Schwefel zusammenhalten' describes a very close and loyal friendship. It is always used in this fixed form.
Die beiden Brüder halten seit ihrer Kindheit zusammen wie Pech und Schwefel.
The two brothers have stuck together like glue since childhood.
happiness / luck
'das Glück' and 'das Pech' are opposites when it comes to chance. 'Glück' then means that something happens to turn out well or that something good happens to you. 'Pech' means the opposite: something happens to turn out badly or you are at a disadvantage. Learners may confuse the words because both often appear in similar expressions, for example 'Glück haben' (to be lucky) and 'Pech haben' (to have bad luck). A practical way to remember it is: for a good chance event, you say 'Glück'; for a bad chance event, you say 'Pech'.

Auf dem Weg zum Bahnhof hatte Max Pech, weil der Bus vor seiner Nase wegfuhr.
On the way to the train station, Max had bad luck because the bus left right in front of him.
Beim Termin hatte ich Glück, denn ich musste nur fünf Minuten warten.
I was lucky with the appointment because I only had to wait five minutes.