Energy is ability to do work And we have potential energy which has a formula of PE=m*g*h And also we have kinetic energy Which has formula of KE=1/2*m*v*v
the ice became smaller and turned to liquid because of the absorption of heat from the surrounding of the ice cube which makes it to change its form from solid to liquid