Beforehand means ahead of the time in question. Book beforehand, told them beforehand, prepared beforehand.
It always refers to a point already named — you cannot say beforehand without something for it to be before — which is what separates it from in advance and earlier. It sits at the end of the clause: let me know beforehand. Note the parallel afterwards; and that beforehand is written as one word, where before hand is not a phrase English uses at all.
1adverbbeforehandAhead of the time in question.
“The interview went well because she had researched the company beforehand.”
beforehand is a relation in time.
Middle English biforhand is before plus hand, translating the Old French avant main. Hand is used for readiness, the same way as in at hand and on hand.
Middle English
biforhand
English, today
beforehand
From Middle English biforhand, biforhond, beforehonde, bifornhand, equivalent to before + hand. [13th century. After Old French avant main].
Etymology from Wiktionary, CC BY-SA