The question about the origin of the elements is a fascinating one, that scientists have been trying to answer for the last seven decades. The formation of light elements in the primordial universe and heavier elements in astrophysical sources occurs through nuclear reactions. We can say that nuclear processes are responsible for the production of energy and synthesis of elements in the various astrophysical sites. Thus, nuclear reactions have a determining role in the existence and evolution of several astrophysical environments, from the Sun to the spectacular explosions of supernovae. Nuclear astrophysics attempts to address the most basic and important questions of our existence and future. There are still many issues that are unresolved, such as how stars and our Galaxy have formed and how they evolve, how and where the heaviest elements are made, what is the abundance of nuclei in the universe and what is the nucleosynthesis output of the various production processes and why the amount of lithium-7 observed is less than predicted. In this paper, we review our current understanding of the different astrophysical nuclear processes leading to the formation of chemical elements and pay particular attention to the formation of heavy elements occurring during high-energy astrophysical events. Thanks to the recent multi-messenger observation of a binary neutron star merger, which also confirmed production of heavy elements, explosive scenarios such as short gamma-ray bursts and the following kilonovae are now strongly supported as nucleosynthesis sites. [ABSTRACT FROM AUTHOR]