Explain the reason for the fusion of an organic compound with metallic sodium for testing nitrogen, sulphur and halogens

Before proceeding for testing of N, S or P in the given organic compound the organic compound is fused with metallic sodium. These elements are present in the organic compound in the form of covalent bond like N in urea or sulphur in thiourea . By fusing the organic compound with sodium, these elements are converted into NaCN or NaX that is, ionic compounds which can be easily detected by ionic reaction