In summary, with the help of operando time-resolved XAS and Raman spectra characterizations, we systematically investigated the crucial role of phase engineering and heteroatom incorporation in the dynamics of the catalytically active species and sites of CoSe2 model catalysts (i.e. o-CoSe2 with a marcasite-type structure, and c-CoSe2 and c-S-CoSe2 with pyrite-type structures) for overall water electrolysis in different media.