system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How does fire emit light (the sun, a candle, a fire, etc.)?
gpt
It's a couple of different things going on, and how much each process contributes to the light produced depends on the type of fire.

The first one, which is responsible for most of the light from things like campfires and candles, is called black body radiation. This is the phenomena that all objects convert heat to light. You don't see cold objects light up, because the amount of light and the wavelength (color) of the light depends on the temperature of the object. Colder objects throw off low energy light like radio waves and infra red. Heat them up more and they start glowing red. More and you'll see more yellow, blue, or white light. Fires give off light like this because the gasses and tiny solid particles flying up from the fir are hot enough to glow.

The other process is due to the burning process giving the electrons inside of the fuel energy. Electrons in an atom are on a kind of energy ladder, where they can step up and down rungs. The burning process takes an electron and bumps it up the ladder a step (or maybe two or three), then the electron falls back down to where it was before. To do this it has to release all that energy that it just had, which it releases as light. When light is produced in this way, it's only in a very narrow wavelength, which means you see a specific, pure color of light from this process, some of which you're unlikely to see from black body radiation which sort of releases a blend of wavelengths together. This is what you see when you burn copper and the flame is green.