Assuming this is a good faith question: while this is not guaranteed, it is highly likely a vaccine will prevent disease transmission (given how the Pfizer and Moderna vaccines help create an antibody response to coronavirus's spike protein), breaking chains in viral spread.
Edit: correction to better reflect the mRNA vaccine mechanism.