Three imidazole ionic liquid solutions were selected to handle coal with distinct degrees of metamorphism to research the influences of cation and anion ions in ionic liquids on functional groups and the relationship between functional groups and coal wettability. The chemical framework of coal was researched by FTIR and the wetting peculiarity of the coal was researched by contact angle meter. FTIR analysis showed that the cation and anion ions in ionic liquids significantly altered the framework of the coal. The contact angle measurement results demonstrated that compared with coal using pure water, the coal handled with ionic liquids showed a smaller contact angle. Finally, the relationship between contact angle and functional group content was analyzed. The results showed that the anions and cations of different ionic liquids can increase the content of hydrophilic groups in coal dust with different metamorphisms, such as OH···O, CO, and CO, and destroy the hydrophobic groups in the dissolved coal structure, such as CH2, CH and the benzene ring 3 substitutions. And 2 % [Emim][BF4] can effectively reduce the coal contact angle and improve the wettability of coal dust. The content of CO and OH···O groups had the greatest correlation with the contact angle, which were 0.845 and 0.754, respectively. By studying the influence of anions and cations in ionic liquids on the content of functional groups in coal, the effect of specific anions and cations on coal structure was further discovered, which provides a theoretical basis for the development of new ionic liquids with specific functions, and provides guiding significance for ionic liquid solutions to improve the wettability of coal and reduce the dust concentration.