In order to this question, we need to know some terms to solve it.
The reducing agent is the one that loses electrons. It is said to have been oxidized.
The oxidizing agent is the one that gains electrons. It is said to have been reduced.
H2 and O2 on the left side of the reaction both have a 0 as oxidation state.
(Atoms of diatomic molecules like hydrogen, chlorine, oxygen, etc, or of metallic chemical elements like Zn, Cu, Na, etc are assigned zero oxidation numbers)
Let's analyze what happens in the H2O molecule:
Hydrogen here has +1 as oxidation state, while Oxygen is -2
Therefore:
The hydrogen molecule goes from 0 to + 1, so it lost electrons, and according to our description above is the reducing agent. Oxygen would be then the oxidizing agent, because its oxidation state goes from 0 to -2, it gained electrons.