White discharge from the eyes? How do you know if it's infected?

See your eye doctor. If you have any sort of discharge from your eyes, regardless of color, it is best to see your eye care professional and have him or her determine whether it is due to an infection or not. It could just be mucus discharge secondary to dry eyes but it is better to be safe than sorry from presuming it is a benign problem when it actually could be more serious.