They are only useless when half the people don't use them and ignore all other measures while they're at it. Obviously there's no need to wear it at home; that's just stupid. But outside, in public space, it catches a lot of those particles that can carry the virus. If everybody wears one, that means less virus particles in the air, and less chance of infection.
And during the pandemic, a lot of countries did indeed not have their usual flu season.
So yeah, masks work in theory, but reality shown us they are completely useless, especially with newer more infectious variants. If they were such great invention we would not have flu and other respiratory viruses, in the end everyone will get infected anyway.