Compare acidity of their conjugate acids.
In NaH , H- is the base and its conjugate acid is H2
K O tert- Bu, base is tert -Butoxide and its conjugate acid is tert-butanol .Now H on the oxygen of tert -butanol is more acidic then H of H2 because of the difference in the electronegativity of H and Oxygen atoms.
Strong acids give weak conjugate base so if I compare tert -Butoxide with hydride ion then hydride is stronger base.Or you can simply compare their pKb values.