What does the cobalt blue glass do?

We had to look through a thin two inch by two inch “cobalt blue glass” to see the color of the element flame. But, I don’t know what the piece of “glass” is supposed to do. I think it has something to do with wave frequency and length?