vorher
beforehand
Indicates a point in time that comes before another specific time or event.
Hättest du mir das doch vorher gesagt!
If only you had told me that beforehand!

beforehand
Loading your saved state.
beforehand
Indicates a point in time that comes before another specific time or event.
Hättest du mir das doch vorher gesagt!
If only you had told me that beforehand!

The adverb 'vorher' (beforehand) is made up of the preposition 'vor' (before) and the adverb 'her'. It describes the time 'before' a specific event.
Wenn du ins Kino gehst, musst du vorher die Karten online reservieren.
If you're going to the movies, you have to reserve the tickets online beforehand.
As an adverb, 'vorher' (beforehand) can stand in different places in the sentence. If it is in position 1, the verb follows directly after it. But it can also stand in the middle of the sentence.
Vorher müssen wir noch die Wohnung aufräumen.
Beforehand, we still have to tidy up the apartment.
The point in time that 'vorher' (beforehand) refers to does not have to be stated explicitly. It is often clear from context, for example 'before the current moment' or 'before what happens next.'
Ich habe den Schlüssel vergessen. Warum hast du das nicht vorher kontrolliert?
I forgot the key. Why didn't you check that beforehand?
'Vorher' (before) is very often used together with 'nachher' (afterward) to compare a state before and after an event. This is useful for before-and-after descriptions.
Vorher war ich nervös, aber nachher war ich sehr erleichtert.
Before, I was nervous, but afterward I was very relieved.
then
'dann' and 'vorher' are clear opposites in time expressions. 'dann' shows that something comes after another event. 'vorher' shows that something happens before another event. So both help you understand a sequence, but from different directions. 'dann' looks forward to the next step, while 'vorher' looks back to what was already earlier.

Vor dem Termin lese ich die Nachricht noch einmal genau.
Before the appointment, I read the message carefully once more.
Im Büro bespreche ich zuerst den Plan und rufe dann den Kunden an.
At the office, I discuss the plan first and then call the client.