How one quark can change into another

There are several different decay processes that can take place that result in the conversion of one fundamental particle into another. 

One of the more common types of such a decay process involves a down quark changing into an up quark (by releasing a negatively charged W boson). 

As you'd expect, when this happens to one of a neutron's two down quarks, that neutron will change into a proton, as it will now have two ups and just one down quark. The negatively charged W boson that was released, then rapidly changes into an electron (and also an electron anti-neutrino) as shown below.  

Image from Georgia State University

This image from Australia Telescope National Facility

This is actually an important part of beta-decay, a type of radioactive decay in which a high-energy electron is released and the type of atom changes... 

e.g. from carbon to nitrogen (as the number of protons, the atomic number (6), increases by one (to 7), while the total number of protons & neutrons (14), the atomic mass number, remains the same).

NB the resulting anti-neutrino is not shown above