What causes the whites of your eyes to turn yellow and how is it treated?

Jaundice. You should get a blood test to check bilirubin levels among others. If elevated you will need further testing to find the etiology. Jaundice is usually caused by liver disease or biliary obsteuction but can also be caused by certain types of blood cell disorders.
See below. Could be scleral icterus: a manifestation of jaundice. High blood levels of bilirubin due to liver or biliary disease can cause this. The underlying cause must be treated to clear the eyes. See your doctor asap.