Cloudy eyes usually mean one of two things. Either it is a bacterial/fungal infection or their eye got injured somehow.
For both cases, usually doing a few extra water changes and keeping the tank extra clean will clear it up (for me anyways). Sometimes meds are needed though. Something that treats bacterial+fungal infections should do the trick.