Accepted Answer
Well,The sun's energy is produced mainly in the core, which has sufficient temperature to initiate nuclear fusion.Hydrogen --> Deuterium --> Tritium --> Helium --> Beryllium? --> Carbon --> ? --> Silicon --> Iron/Nickel = Most massive stars
Suggested Answer
By the nuclear fusion.