The sun does not burn thanks to a chemical combustion such as the flame fed by oxygen. The sun carries out nuclear fusion instead of using oxygen. The sun is not like a giant ball of fire, it is more like a gigantic hydrogen bomb. That is quite close to earth… but far enough away for the effects to be minimal.