The dictionary form of a verb, followed by the phrase mae ni ("before"), is used to indicate a temporal relation between one action and another: before doing one thing (or before one thing happens), one does another thing, (or another thing happens.) The tense of a sentence with mae ni is determined by the final verb.
Gakusei wa uchi e kaeru mae ni kyōshitsu no mado o shimemasu.
The students close the classroom windows before going home.
Ginkō e iku mae ni pan'ya ni yotte.
I stopped by a bakery before I went to the bank.
Kazuo-san wa benkyō suru mae ni enpitsu o kezurimasu.
Kazuo sharpens his pencil before he studies.
Hope this helps!
°˖ ✧◝(○ ヮ ○)◜✧˖ °こゆうきあいはら°˖ ✧◝(○ ヮ ○)◜✧˖ °