Libertarians believe that force should be applied to person A to protect person B from person A in certain circumstances.
If person A wants to punch person B in the face, restricting person A by force is perfectly consistent with libertarian values.
If person A threatens to infect person B with a deadly disease due to refusing a vaccine, then a vaccine mandate has some justification under the same ideals. The devil will be in the details (e.g., how deadly is the disease, etc).
It's also why a carbon tax and many other measures are not inherently inconsistent with libertarian values on a first principles examination.
But for some reason, libertarians in practice tend to dislike these policy proposals, even though they can follow in principle from the founding axioms. I attribute that to group-think and a general disbelief in the existence of negative externalities, not to a problem inherent in libertarianism.