We have to know how flame colour can be used to identify the metal ion in an unknown compound.
If golden yellow coloured flame , then Na⁺ ion because electrons get excited on heating and again fall back to emit energy of definite wavelengths corresponding to particular colour in the visible region.
If violet coloured flame , then K⁺ because electrons get excited on heating and again fall back to emit energy of definite wavelengths corresponding to particular colour in the visible region.
If crimson red coloured flame , then Sr²⁺ because electrons get excited on heating and again fall back to emit energy of definite wavelengths corresponding to particular colour in the visible region.
If yellowish green coloured flame , then Ba²⁺ because electrons get excited on heating and again fall back to emit energy of definite wavelengths corresponding to particular colour in the visible region.