Fort D High School

I saw on the news that a person may have tested positive for TB and may have spread it.
How? if they were wearing their mask and others were wearing theirs.
So if masks work for covid why not tb since it’s transmitted through the air.