Dear student
When a metal reacts with a dilute acid hydrogen gas is released . For ex when Mg reacts with dil.HCl, we get MgCl2 and Hydrogen gas is released.
Mg(s) + 2HCl(aq) MgCl2(aq) + H2(g)
When a burning candle is brought near the test tube a pop sound is heard , which proves that Hydrogen gas is released.
Regards