Sangeetha Pulapaka
3

A young star is composed primarily of hydrogen, the simplest chemical element. This hydrogen ultimately leads to all known elements. First, the two constituents of each hydrogen atom—its proton and electron— are separated. The high pressure inside the star can literally squeeze together two protons, and sometimes, a proton will capture an electron to become a neutron. When two protons and two neutrons band together, they form the nucleus of helium, which is the second element in the periodic table. Then, when two nuclei of helium fuse with each other, they form the nucleus of another element, beryllium. In turn, the fusion of beryllium with helium produces a carbon nucleus; the fusion of carbon and helium nuclei leads to an oxygen nucleus, and so on. This way, through successive fusion reactions, the nuclei of most elements lighter than iron can be formed. Scientists call this process nucleosynthesis.

                                  


In stars, these fusion reactions cannot form elements heavier than iron. Up until the formation of iron nuclei, these reactions release energy, keeping the star alive. But nuclear reactions that form elements heavier than iron do not release energy; instead, they consume energy. If such reactions happened, they would basically use the star’s energy, which would cause it to collapse. Not all stars form iron, though. 

More on this

https://www.forbes.com/sites/startswithabang/2018/05/04/how-do-the-most-massive-stars-die-supernova-hypernova-or-direct-collapse/#5b0f8bbe35fd