Earlier in its lifetime, the star began fusing hydrogen and helium in its core into heavier elements through the process known as "." The energy made by the fusion of heavier and heavier elements balanced the star against the force of gravity. These reactions continued until they formed iron in the core of the star. At this point, further nucleosynthesis would consume rather than produce energy, so gravity then caused the star to implode and form a dense stellar core known as a neutron star.
During most of a star's lifetime, hydrogen nuclei fuse together to form helium nuclei. As the star runs out of hydrogen, other fusion reactions take place forming the nuclei of other . Heavier elements than hydrogen and helium (up to iron) are formed. Elements heavier than iron are formed in .
Elements higher than iron cannot be formed through fusion as one has to supply energy for the reaction to take place. However, we do see elements higher than iron around us. So how did these elements form? The answer is supernovae. In a supernova explosion, neutron capture reactions take place (this is not fusion), leading to the formation of heavy elements. This is the reason why it is said that most of the stuff that we see around us come from stars and supernovae (the heavy elements part). If you go into technical details, then there are two processes of neutron capture called rapid process (r-process) and the slow process (s-process), and these lead to formation of different elements.