How are the heavy elements formed? This has been a key open question in physics for decades. Recent direct detections of neutron star mergers and observations of evolved stars show signatures of chemical elements in the blue range of their spectra that bear witness of recent nuclear processes that led to heavy element production. The formation of heavy elements typically takes place through neutron-capture reactions creating radioactive isotopes, which following beta-decay turn into the stable isotopes we today can measure indirectly in the surfaces of cool, low-mass stars or meteoritic grains. The conditions (such as the neutron density or entropy) of these n-capture reactions remain to date poorly constrained, and only through a multidisciplinary effort can we, by combining and comparing observations, experiments, and theoretical predictions, improve on one of the top 10 most important open physics questions posed at the turn of the century. This emphasises the need for detailed observations of the near-UV to blue wavelength region. The shortage of spectrographs and hence spectra covering this range with high-resolution and high signal-to-noise has for decades played a limiting factor in our understanding of how heavy elements form in the nuclear reactions as well as how they behave in the stellar surfaces. With CUBES (Cassegrain U-Band Efficient Spectrograph) we can finally improve the observations, by covering the crucial blue range in more remote stars and also achieve a higher signal-to-noise ratio (SNR). This is much needed to detect and accurately deblend the absorption lines and in turn derive more accurate and precise abundances of the heavy elements.