The best way to keep immunocompromised and people who literally can’t take vaccines safe is by having so much herd immunity that the likelihood they a virulent load of a virus cannot get to those people.
A great way to get herd immunity is through mass vaccination.