前にbefore; ago
前に is "before": 寝る前に, before going to bed. After an amount of time it is nearly always "ago": 三年前に, three years ago.
before doing
I read a little before going to bed.
before a noun
Let's wash our hands before the meal.
Before doing
Verb in the dictionary form + 前に
行く前に, 食べる前に. Always the dictionary form, even when the sentence is about the past.
Before a noun
Noun + の + 前に
食事の前に, 試験の前に.
Ago
Amount of time + 前に
No の: 三年前に, 一時間前に.
Before doing something
寝る前に is one piece, "before sleeping": 前に follows its verb, where English "before" goes in front. The rest of the sentence is what you do first.
I close the windows before leaving home.
I sat down before the movie started.
The first half can have its own subject, marked with が.
Always the dictionary form
The thing before 前に has not happened yet when the other one does. So its verb stays in the dictionary form, even in a sentence about the past.
Yesterday, I wrote in my diary before going to bed.
Not said: 昨日、
(Yesterday, I wrote in my diary before going to bed.)
あとで, "after", is the other way around.
I wash my hands before eating.
Before: the meal is still ahead. Dictionary form.
I brush my teeth after eating.
After: the meal is over. た-form.
Before a noun
A noun needs の. A verb never takes it.
I bought new shoes before the trip.
Ago
After an amount of time, 前に counts back, nearly always from now. There is no の.
I had lunch an hour ago.
Not said: 三年の
(I came to Japan three years ago.)
三年前に.
By itself, 前に can mean "before" in the sense of "at some time in the past".
I've seen this movie before.
前に or てから?
The same two things can be told from either end.
I brush my teeth before going to bed.
前に goes on what happens later.
I brush my teeth, and then go to bed.
てから goes on what happens first.
Close neighbours
あとでN5
"After" as a time, and by itself "later". A verb before it is in the た-form.
I will have a meal with a friend after work.
てからN5
"After doing", with the order in plain view. It is also "since".
It has been three years since I came to Japan.
After a place or a thing, の前に is "in front of".
There is a bank in front of the station.
Check yourself
1Which one fits?
昨日、
Choose an answer to see why.
2"The bus left ten minutes ago."
バスは
Choose an answer to see why.
3What does this person do first?
出かける
Choose an answer to see why.
More detail
Three days before the exam
With an event in front, the amount of time counts back from that event and not from now.
I caught a cold three days before the exam.
Without の
In writing, and on signs and labels, the の is often dropped after a noun for an event: 出発前に (before departure), 使用前に (before use).
I checked my ticket once more before departure.
More sentences
Please write your name at reception before the meeting.
I will study at the library before the exam.
I brought the laundry inside before it rained.
I practiced my answers to questions before the interview.