Thermal energy always flows spontaneously from the body that is at a higher temperature to the body that has a lower temperature.
In this case, the thermal energy flows from the hot beverage that is at the temperature t1 to the ice cube at the temperature t2 until the two reach the same temperature t3.
Where:
t1> t2 <t3.
The ice cube would emit heat if the temperature of the liquid with which it comes in contact with the smaller than that of the ice.