Water becomes cold if we add some ice cubes to it because of conservation of energy.
Heat is a form of energy. The temperature of water is more than ice cubes, so the heat flows from the water to ice cubes. The heat gained by the melting of ice cubes comes from the heat lost by liquid water. As the water loses heat, its temperature falls.