The invention discloses a preparation method of a binary and ternary transition metal hydride catalyst and its application in electrocatalytic hydrogen evolution and fuel cells. The molecular formula of the catalyst is Pt / H x m a R b Y c o 3 , where M, R, Y are three different transition metals, x value is 0.01~1, 0≤a<1, 0≤b<1, 0≤c<1, a+b+c=1, in the catalyst The mass content of Pt is 0.01%-20%. Pt / H for this application x m a R b Y c o 3 As a catalyst for electrolysis of water, its electrochemical performance in acidic electrolytes is comparable to that of commercial carbon-supported platinum catalysts, and the Pt / H x m a R b Y c o 3 It has extremely high stability, and the preparation process is simple and easy to scale up. Therefore, it can be used as a substitute for carbon-supported platinum catalysts to effectively reduce the cost of hydrogen production. Such bifunctional catalysts with electrocatalytic hydrogen evolution and oxygen reduction reactions have never been reported.