A vaccine can do both. It causes the natural immune system to recognize and fight the virus. You are being exposed to viruses all the time. You don't get "sick" because your immune system is always cleaning house. The trouble comes when the cleaning crew doesn't recognize a pile of trash as a pile of trash. the pile of trash is able to get bigger all by itself. Like what happens in my garage.
My suggestion is to examine how the 2021-version of the injection called a “vaccine” works.
A better name might be gene therapy, IMHO.