Hydrogen sulfide and alkanethiols are toxic compounds containing in the production of wells in many oil and gas condensate fields. Because the policy of hydrocarbon processing enterprises aimed at the development of new fundamental research, processes and technologies in order to find rational use of raw materials, the conversion of hydrogen sulfide and alkanethiols into valuable compounds is one of the strategic goals of the oil and gas industry. The methods of "green" chemistry are perspective processes for converting hydrogen sulfide and alkantiols into valuable organic compounds, which allow working in environmentally friendly conditions with minimal energy and resource costs. The reactions of direct nucleophilic substitution of butanol-2, pentanol-1 and hexanol-1 to HS- and RS- group by single-electron reduction of hydrogen sulfide and alkanthiol in acetonitrile and ionic liquid at room temperature and atmospheric pressure with a single by-product - H2O were described. The possibility of conducting an experiment without electrolyte due to the intrinsic electrical conductivity of the ionic liquid allows not only lowering the consumption of reagents, but also facilitating the isolation of the target product. Due to the structuring and the matrix effect in ionic liquids, the duration of electrolysis in the reactions under consideration is 2-3 times less than in the case of aprotic solvents.