(i) In the reaction of dihydrogen with metals to form metal hydride it acts as an oxidizing agent
2Na(s) +H2 (g) --------------> 2Na+H
Here Na has oxidized to Na+ and Dihydrogen is reduced to hydride (H- ) ion
(ii) In the reaction of heated cupric oxide with dihydrogen to form H2O and copper metal dihydrogen acts as a reducing agent
CuO(s) +H2 (g) ------------> Cu(s) +H2O