I am a paediatrician and obviously find vaccine refusal incredibly upsetting and frustrating, because it kills and maims children.
Obviously it's a little different for me because I have a professional duty to promote children's health, which means engaging with vaccine refusing parents. I can't (or shouldn't) just switch off from the conversation, however frustrating it is.
Vaccine refusal doesn't make you a "bad person", whatever that means, but those parents I have encountered professionally who are vaccine refusers do seem to have poor critical thinking skills. Or they have overridden their critical thinking. Inevitably I suppose, because vaccines are among the safest and most studied medicines available, and their benefits are clear. There are usually other aspects of their parenting which are very caring and conscientious. They are usually, ironically, health anxious individuals. They do not have a good grasp on risk. Often they present very anxious when their children have very minor illness. They don't appreciate the difference between minor illness and serious or life threatening illness. A benign birthmark may be a terrifying omen. A viral rash or crying baby a sign of something very wrong. At the same time they fear and mistrust medical professionals. I think parenting with all of these factors going on is probably a frightening and lonely experience and I mostly feel sorry for them. I often think that maybe brain damage or death from vaccine preventable sepsis or encephalitis is actually more than they can bear to think about. A minority are just utter arseholes and it's completely about their ego (same can be said of some parents who do vaccinate of course!). But nearly all parents mean well for their children and prioritise their children as best they can. I think it's good for empathising with such parents, not to totally define them by their vaccine refusal, even though that is often a big part of how they define themselves.
The claims of anti-vaxxers fall apart without much scrutiny so there is usually some other driving factor behind believing them. I speculate that there is something gained psychologically (particularly for frightened individuals who distrust or are almost phobic of conventional medical authority - and often because of genuinely poor experiences) in belonging to a community that never doubts, questions or changes its beliefs. That tells them they are right, and that they are doing a good job to protect their child. The security of that is comforting and gives people an illusion of superiority, control and safety. The same appeal as all cults and conspiracies.
I find that you can't really improve an adult's critical thinking skills. So you have to explore the emotional reasons and concerns behind the refusal. And empower them to face the fear, actually face the decision (with it's risks, however minimal they are) and possibly change their mind. Something they will have to do alone, without a whole community telling them they're right. Possibly actually losing a community in the process. I don't think fear tactics or guilt trips work - emotionally the easiest response to negative emotions is to retreat to your place of safety and certainty, which is likely to be the beliefs that are driving the vaccine refusal! Fear and guilt disempower.
The most useful thing is to provide reassurance, and empathy, and kindness. To be another human being so that you reduce the us-and-them mentality which feeds cultish thinking. If somebody who refuses vaccines can see that you are a reasonable and kind person who is similar to them in many ways, and shares some or many of their parenting values, and yet you immunise your children, over time they may want to align with you instead of the fear-vampires making them terrified of vaccines. You can offer them an alternative to the community that is supporting them (at the potential cost of their children's health, though they won't see it that way). One of the most powerful statements I make as a health professional is "if I was my baby/child, I would absolutely want them to have this treatment" or "I chose this treatment for my child".
So, like all friendships, if it's a constant bone of contention that means spending time together is not pleasant, by all means, don't spend time with them. But if you can reach out and find why you have in common with this person and be their friend, you might save them or another family some real heartache (of course, the best and worst thing about vaccines is you never get to see what they have prevented). It might take months or years but it is not a lost cause.