Fire is a chemical reaction that creates light and heat from oxygen and fuel. A litcandle needs to draw oxygen from the air in order to continue burning. If you limit the amount of air available, the candle's flame eventually goes out once it uses up all the oxygen.
So if we have carbon and we oxidize it to form carbon dioxide, the reaction of carbon with oxygen will release a lot of energy in the form of heat. Therefore, oxygen is necessary for burning because that is how we define burning.