Sodium metal reacts violently with water because it is much more active than hydrogen. When sodium is put into water, the de-localised electrons flow into the water leaving the positive ions to remain. The positive ions strongly repel each other and this repulsion causes the metal to explode.
2Na(s)+H2O(l)→2KOH+H2(g)+Heat energy
Metals lime Na, K, Ca, Mg etc. react with water to produce metal oxide and hydrogen gas. Sodium and potassium reacts violently with cold water and evolve hydrogen, which immediately catches fire.