Saline hydrides such as NaH,CaH2 violently react with water and form metal hydroxide and hydrogen gas.
NaH(s)+H2O(l)→NaOH(aq)+H2(g)
CaH2(s)+2H2O(l)→Ca(OH)2(aq)+2H2(g)
During these reactions, large amount of energy is released so that hydrogen catches fire. CO2 cannot extinguish this fire as it is reduced by hot metal hydride.
NaH+CO2→HCOONa
To extinguish this fire, sand (a highly stable solid) can be used.