The Sun shines because it is able to convert energy from gravity into light. ... This is what happens to the hydrogen gas in the core of the Sun. It gets squeeze together so tightly that four hydrogen nuclei combine to form one helium atom. This is called nuclear fusion.
I hope there helped you with something!