Urea and organic molecules assisted electrochemical water splitting is a promising strategy to realize energy-saving hydrogen production and simultaneous treatment of wastewater containing urea and organic pollutants. It is an effective approach to develop advanced electrocatalysts being of excellent catalytic performance by constructing a metal-semiconductor or semiconductor-semiconductor heterogeneous interface to regulate the electronic structure, thus forming the highly catalytic sites. Herein, we prepared a NiFe LDH/MoS2/Ni3S2 ternary heterojunction as a bifunctional catalyst on nickel foam (NiFe LDH/MoS2/Ni3S2/NF) via constructing Schottky interface and p-n heterojunction interface. In view of the built-in electric field between the heterogeneous interfaces, the electron transfer in interfaces is accelerated, and the adsorption of OH- and the dissociation of urea are also promoted, which results in excellent electrocatalytic performance including hydrogen evolution reaction (HER), oxygen evolution reaction (OER), urea oxidation reaction (UOR) and ethanol oxidation reaction (ETOR). At 50 mA cm−2, the voltages of HER, OER, UOR and ETOR are −0.100, 1.511, 1.410, 1.427 V vs. RHE, respectively, better than the most of reported electrocatalysts. In two-electrode electrolytic cells using NiFe LDH/MoS2/Ni3S2/NF as cathode and anode catalysts, this material also exhibits the outstanding catalytic performance in electrolytes of 1.0 M KOH, 1.0 M KOH containing 0.5 M urea and 1.0 M KOH containing 0.5 M lactic acid. This research provides a feasible approach for constructing advanced electrocatalysts by combining the different metal-based compounds to form the heterojunction with highly catalytic sites, thus realizing the aim of acquiring hydrogen energy and simultaneous treatment of urea wastewater and other organic pollutants.