At the beginning of the Universe only light elements such as H, He, Li were produced. Heavier elements such as C, O, Fe and neutron-capture elements were created inside stars. Mass loss from AGB stars and (rotating) massive stars produce a significant fraction of C, N, F, and minor isotopes of O and Mg, as well as the slow-neutron capture elements. I will summarize the origin of stable elements using my Galactic chemical evolution model, comparing to the observations. The discovery of rare star SMSS J200322.54-114203.3 ([Fe/H]=-3.5) strongly supported magneto-rotational hypernovae for the r-process site, in addition to neutron star mergers. The detection of fluorine in a high-redshift galaxy NGP-190387 indicates the importance of stellar rotation in the early Universe. In a galaxy, chemical enrichment takes place inhomogeneously, following star formation, gas inflow, radial flow, and outflow, and stellar migration, and I will also show chemodynamical simulations, which can be tested by future observations such as with the JWST.