Sodium is not used to prepare hydrogen from hydrochloric acid (or any other acid). Why ?
Sodium is not used to prepare hydrogen from acids because sodium metal is highly reactive. So, the reaction with acids is much exothermic and there are more chances of explosion. It is also very dangerous to handle sodium metal.