"Ago" is an adjective, so use it tell more about a noun:
a long time ago
twenty years ago
a century ago
"Before" is an adverb, so use it with a verb:
Before you leave, wash your hands. / Wash your hands before you leave.
They practiced before they sang.
She went before he did.
I will pray before I eat.