Surgical masks are mostly about protecting the everyone else from the weaer, yes, but do provide a small benefit to the wearer as well as least with virions for influenza and coronaviruses. Depending on what study, rates of transmission reduction were 10-20% for the wearer, which doesn't sound huge but greatly reduces transmission at scale.
The filter masks like N95s (which are usable for all kinds of non-medical purposes like working around airborne particles of fiberglass or metal debris or whatever) offer a high degree of protection to the wearer as well.