To burn anything we need oxygen but have you ever thought why our sun does not need any oxygen to burn and how does it burns without any oxygen?
The answer is sun never burns. Sun is not burning. What is burning ? Burning is combustion. Anything that burns needs oxygen, combustion is a chemical reaction which occurs between fuel and oxidizer to create a new substance called exhaust.
If sun was burning it would also create smoke, but we don’t see sun creating a smoke, infant there is no exhaust created by sun.
If sun does not burn then why sun looks like its burning?
There is a nuclear fusion going on at sun where one proton smashes another proton. This kind of fusion is called proton proton fusion.
These protons fuse together to create helium and this transformation creates a tremendous amount of energy that keeps the sun hot and it looks like it’s burning.