The -us ending on pessimus shows that the adjective is nominative, singular, and masculine.
That's how we know that it describes the masculine nominative noun, ignis : "a very bad fire," "a terrible fire."
If we wanted to say, "Fire destroys the worst bridge," we would need to use an accusative singular masculine form of the adjective (namely, pessimum ), to modify the accus. sing. masc. noun, pontem .
EDIT: SuzanneNussbaum beat me to it and explains it nicely.
Here, you can tell based on the case of pessimus. It is nominative, so it would match with the noun in the nominative, which can only be ignis in this sentence. Pontem is accusative so it would need pessimum.
Adjectives match with the nouns they modify in case, number, and gender (when they modify multiple nouns gender of the adjective is treated a little differently).