C and H
Carbon and hydrogen are detected by heating the organic compound with cupric oxide (CuO) strongly. C is oxidized to CO2 and H to H2O.
CO2 will turn lime water milky, whereas H2O will turn white anhydrous copper sulphate to blue.

N, S and Halogens
These elements, if present in an organic compound can be detected by converting them into water soluble organic compounds by fusing the given organic compound with sodium..
Organic compound Ionic Compound
C, N, S, X NaX
+ NaCN
Na ------> Na2S
NaCNS
These ionic compounds can be detected using various reagents...
e.g. Halogens can be detected using AgNO3. (AgX will be White precipitate for X= Cl, Pale yellow for X= Br, Bright yellow for X= I)
NaX + AgNO3 -------> AgX + NaNO3
Similarly for NaCN and NaCNS...