Ice cubes melt the fastest when they have the most possible surface area relative to their volume. In general, rounder shapes melt more slowly than flatter shapes do. Conversely, ice cubes with very low amounts of surface area relative to their volume melt slowly. This is because the surface of the ice cube is where the heat from the surroundings is absorbed.
The more of the ice that is in contact with the warm air or water, the quicker its temperature will climb. This means that ice cubes with high surface to volume ratios melt more quickly than those with low surface to volume ratios do. Different shapes have different characteristic surface to volume ratios. For example, a sphere has the lowest amount of surface area possible, relative to its volume. Therefore, a sphere of ice will melt the slowest of any shape. By contrast, flat, sheet-like ice has a very high amount of surface area relative to its volume, and ice in such a shape melts extremely quickly.
In the natural world, heat travels from areas where the temperature is highest to places where the temperature is lowest. Ice cubes melt as they absorb heat from the external environment. This elevates the temperature of the ice, raising it above the melting point. Once water is over 32 degrees Fahrenheit it begins shifting to the liquid state, melting the ice cube.