Small amounts of hydrogen are conveniently prepared in laboratory by the reaction of metals, such as zinc, iron and tin, with dilute acid.
In principle, any metal with a negative standard reduction potential will react with an acid to generate hydrogen.