Ice cubes can technically last for a long time in the freezer without going bad in the sense of becoming unsafe to consume. The freezing process and low temperatures help preserve the ice cubes and inhibit the growth of bacteria or other harmful microorganisms.
However, ice cubes can deteriorate in quality over time. They may absorb odors from other foods in the freezer, leading to a change in taste. Additionally, ice cubes can become stale or freezer burnt, resulting in a loss of flavor and texture. This can make them less desirable for use in beverages.
If you have an ice cube that has been stored in the freezer for two years, it's best to assess its quality before using it. Inspect the ice cube visually and sniff it to check for any unusual odors. If it appears and smells normal, you can give it a taste to see if it has maintained its quality. If the ice cube seems fine in terms of taste, odor, and appearance, it should be safe to use in a drink. However, if there are any signs of spoilage or the ice cube has an off-putting taste or smell, it's better to discard it and make a fresh batch of ice cubes.