What keeps the Sun burning is the thermonuclear fusion that it's fueled by and the fact that it also burns the fuel slowly.
The reason why the Sun hasn't run out of fuel is because the sun is actually still mainly fueled through thermonuclear fusion.
Thermonuclear fusion is a process which converts hydrogen into helium and it's a process that is very efficient.
The immense size and gravity of the Sun also allows the Sun to continue fusing hydrogen at a slow but steady rate.
The Sun has only used around half of it's energy producing hydrogen and the Sun will be able to continue burning for billions of years yet before it eventually becomes a red giant and then eventually a white dwarf.
The core of the Sun is extremely hot and dense, which allows the hydrogen atoms to fuse together at a rate which releases tremendous amounts of energy.
And the fusion process is what creates helium and also releases energy in the form of light and heat.
The energy that is released by converting just one kilogram of hydrogen to helium is the same as burning 20,000 metric tons of coal.
The Suns core also has a power density that is similar to that of a compost heap, but due to it's enormous size it allows for a massive amount of production of energy.
The core of the Sun is in a state of hydrostatic equilibrium, in which the pull of gravity is balanced by the outward pressure from the nuclear fusion process.
The balance is what prevents the Sun from exploding or collapsing.
The Sun is also not burning it's fuel in a rapid or explosive way such as a fire on earth would.
Instead the Sun is burning hydrogen very slowly and steadily and so it releases energy gradually over billions of years.
The core of the Sun is also converting around 600 million tons of hydrogen into helium every second and the remaining 4 million tons are converting into energy.
It's estimated that eventually the Sun will run out of hydrogen in it's core and then the Sun will transition into a red giant stage and expand significantly and cool down.
After this, the Sun will become a dwarf and a dense cool remnant of it's former self.