Have you ever seen a campfire or a lighter? When you light them up, you see different colors, right? This happens because the fire is burning different elements in the wood or gas that create different colors of light.
Now imagine taking a tiny bit of a chemical, like table salt or copper sulfate, and putting it into a fire. When the chemical burns, it releases energy which makes the flames turn into different colors, just like the campfire or lighter.
Scientists use a special tool called a flame test to identify different elements in chemicals by looking at the color of the flame they produce. They put a small amount of the chemical on a piece of wire, hold it over a flame, and observe the color of the flame. Each element produces a unique color, like sodium turns the flame yellow and copper turns it blue-green.
So basically, the flame test helps scientists figure out what elements are present in a chemical by looking at the color of the flame the chemical produces when it burns.