The yellow colour flame in the flame test indicates that the alkali metal must be sodium. Na+ ions participate in the transmission of nerve signals. Sodium reacts with O2 to form a mixture of sodium peroxide (Na2O2) and sodium oxide (Na2O).
4 Na + O2 →2Na2O (Minor)
2 Na2O + O2 →2Na2O2 (Major)
2 Na + O2 →Na2O2
When sodium metal or its salt is heated in Bunsen flame, the flame energy causes an excitation of the outermost electron which on reverting back to its initial energy level, gives out the absorbed energy as visible light and complementary colour of absorbed colour becomes visible in the flame.
That's why sodium imparts a yellow colour to the flame.