Complex sentence: The second to last flat in the key signature is the note used to name the key; for example, if that note is B then the key is Bb.
Split into simpler sentences: The second to last flat in the key signature is the note used to name the key. If that note is B then the key is Bb.