The sun is not actually a fire, in fact it is much much hotter than most fires you’ve ever experienced. Although it is burning in a metaphorical sense.
Most of the fires that you’ve experienced are chemical in nature. That is to say that they are nothing but a chemical reaction. Hydrocarbons or carbohydrates or other fuels are combined with oxygen or other oxidizers in an oxidation reaction, the oxydizer shares electrons with the atoms in the fuel substance and becomes bonded to them. The formation of these bonds releases energy in the form of light and heat. With hydrocarbon fuels and oxygen, the chemical byproducts are usually Carbon dioxide and water (as steam), though some carbon monoxide can be formed.
The reaction that is happening in the sun is not a chemical reaction like this but rather a nuclear reaction. In the sun, atoms of hydrogen are under such intense temperatures and pressures, that the very protons are forced together to form deuterium and tritium (the heavier isotopes of hydrogen), and more importantly helium. In stars heavier than our sun, the helium can be further compressed until it forms even heavier elements like the carbon makes up much of life on earth or the calcium in your bones, all the way up to the Iron in your blood and in common magnets and steel. When stars start producing iron, it means they have used up all the energy they have and are about to die. In many stars, the iron they produce is expelled in super novae that produce even heavier elements and spread the materials across space to be picked up as new star systems form. Our star is not hot enough to fuse helium and will simply die when most of it’s hydrogen is used up in about 5 billion years, leaving behind a white dwarf, which will gradually cool over about a trillion years. In the next 1000 years however, we should be able to actually remove material from the sun in a process called star lifting, which will slow it’s aging so that we can enjoy it for several hundred billion more years before it gradually transitions to a white dwarf anyway. We will also be able to use many of the heavier elements we pull out of the sun as construction materials to build space habitats where trillions of people can live in relative luxury.