The presence of magnesium and calcium carbonates in water makes it temporarily hard. In this case, the hardness in water can be removed by boiling the water.
When we boil water the soluble salts of Mg(HCO3)2 is converted to Mg(OH)2 which is insoluble and hence gets precipitated and is removed. After filtration, the water we get is soft water.