Thanks to nuclear astro-physics collaboration, we now have good understanding of the origin of elements from carbon to zinc, and theoretical models have well reproduced the observations of these elemental abundances in the Milky Way Galaxy. Now we can constrain galaxy formation processes such as supernova and AGN feedback using metallicities and elemental abundances. Our cosmological simulations are in good agreement with many observations, namely, mass-metallicity relations of galaxies (which evolve with a steeper slope at higher redshifts) and metallicity radial gradients within galaxies (which can trace the merging history of the galaxies). Stellar [alpha/Fe] ratios of early-type galaxies become closer to observations with AGN feedback (where the seed blackholes originate the first stars). The gas-phase C, N and O abundances can constrain the star formation history of disk galaxies, which can be used for future observations with JWST. In the Milky-Way simulations, we also show neutron-capture elements, including the recent discovery of kilonova (GW170817) as one of the r-process sources.