Light energy from the sun is used to split water molecules (photolysis). The sunlight hits chloroplasts in the plant. This causes an enzyme to split the water. Water, when split, gives oxygen, hydrogen, and electrons.