Stellar nucleosynthesis is the process by which stars forge elements inside their cores.
The only element not formed in this way is hydrogen, the most abundant and lightest element in the universe: it was formed in the initial aftermath of the Big Bang.
The cores of stars have crushing pressures and temperature. For example, the Sun’s core temperature is about 15 million degrees C. In these harsh conditions, the nuclei of atoms undergo nuclear fusion.