Before, Ago

לפני הארוחה אני שותה כוס מים. Before the meal I drink a glass of water.
לפני השינה אני שותה כוס חלב. Before I go to sleep ("before the sleep") I drink a glass of milk.
הוא בא לפני שלושה ימים. He came three days ago.
זה קרה לפני שנה. This happened a year ago.

With a verb, a ש intervenes:

לפני שאתה אומר משהו, תחשוב על ההשלכות. Before you say something, think about the consequences.
לפני שאתה יוצא, תתקשר אלי. Before you go out, call me.