Because they can both mean "before," there is often confusion between the prepositions avant and devant. But there's a big difference in the way these words are used, so read this lesson before you make any more mistakes.
Avant expresses something to do with time or arrival at a physical location. Avant
can be with expressions of time, nouns, and pronouns.
before the test
Je me suis arrêté avant le carrefour.
I stopped before [arriving at] the intersection.
Il est parti avant moi.
He left before me.
Avant de is used with infinitives
avant de partir
avant de manger
Avant que is used with clauses and requires ne in front of the verb (why?)
avant qu'il ne parte
before he leaves
avant que tu ne manges
before you eat
Devant expresses position or location (figurative or literal) and means "before" or "in front of."
It can be used only with nouns and pronouns.
devant la voiture
in front of the car
devant les juges
before the judges
devant le danger
faced with / in the face of danger
Il est devant toi.
He's in front of you.
Test: Avant vs devant
Also see: Après vs derrière