The sun is a huge ball of gas held together by gravity.
It does not burn the way wood does, due to oxygen, but it gets energy by a process called nuclear fusion, where Hydrogen is converted to Helium.
The sun will cease to "burn" when it runs out of Hydrogen, but that has a long way to go.