The adverb “autrefois” means “in the past” or “formerly,” referring to a habitual or descriptive past action.
In French, when talking about past conditions or repeated states in the past, we use the imparfait.
“Être” in the imparfait for “cette ville” (3rd person singular) is était.
So the complete sentence is: Autrefois, cette ville était polluée mais maintenant ce n’est pas le cas.