The conversion of renewable energy sources with relatively large energy fluctuations into hydrogen represents a crucial aspect of energy storage. Nevertheless, the direct water electrolysis process is known to require excessive instantaneous energy consumption and high cost. Two-step alkaline water electrolysis is regarded as a secure and effective method of generating hydrogen from renewable energy sources when compared to direct water electrolysis. Here we propose a two-step alkaline water electrolysis using nickel–cobalt based hydroxide (Ni0.9Co0.1(OH)2) as a redox mediator, and a high-performance bifunctional catalyst as gas evolution electrodes (GEE). The substrates for the GEE were prepared using 3D printing and then loaded with in-situ grown Ru-doped MoS2/NiFe-LDH hierarchical heterostructure catalysts (MS-NiFe-Ru-3D). The oxygen evolution reaction (OER) and hydrogen evolution reaction (HER) of the MS-NiFe-Ru-3D catalyst can reach up to 500 mA cm−2 at 300 and 250 mV overpotentials, respectively. It can meet the requirement of high catalyst performance for two-step alkaline water electrolysis. The direct water electrolysis using the bifunctional MS-NiFe-Ru-3D catalyst only requires a voltage of 1.85 V at 500 mA cm−2 with minimal attenuation over 300 h. For the two-step alkaline water electrolysis using MS-NiFe-Ru-3D as bifunctional catalysts and Ni0.9Co0.1(OH)2 as redox mediator, only 1.70 V and 0.27 V were required for HER and OER at 500 mA cm−2, respectively. This work offers a promising avenue for the efficient conversion of renewable secondary energy sources into hydrogen.