I am a beginner Physics student and I am studying the weak nuclear force and how particle interactions work. Now, from my book and the Feynman diagram, I learned that a neutron can change into a proton when it interacts with a neutrino, this happens because W$^-$ bosons are exchanged between $\nu$ and $n$; therefore $n$ is converted into a proton and $\nu$ is converted into a positron.
I am not sure if what I wrote above is correct. My real doubts come when talking about beta decay; I know that in beta decay, a neutron converts into a proton, but where does the W$^-$ boson come from? I mean the neutron doesn't interact with another particle, so why is the boson is even there?