Use the adverb formerly to describe something that happened earlier. A history teacher might explain that the city of Istanbul was formerly known as Constantinople.
Something that existed previously, or that has changed in some way over time, can be talked about using the word formerly. Your graceful math teacher might have formerly been a professional dancer, and the building where you take fencing lessons could have formerly been a textile mill. If something happened once upon a time, it happened formerly. The origin of the word traces all the way back to the Proto-Germanic formo, or "first."