In a cup of ice cold water, the water molecules are moving very slowly. They don't have much energy and are not moving around very much. This is why ice is solid and doesn't flow like liquid water.
When you put a cup of boiling hot water next to a cup of ice cold water, the heat from the hot water will transfer to the cold water. This will cause the water molecules in the cold water to start moving faster. As the water molecules in the cold water move faster, they will start to collide with each other and the sides of the cup more often. This will cause the cold water to start to heat up.
Eventually, the temperature of the hot water and the cold water will equalize. This means that the water molecules in both cups will be moving at the same speed. At this point, the water in both cups will be the same temperature.