Many beginners have a tendency to keep their eyes closed when learning how to swim. This is not correct. The water will not hurt your eyes. If they sting a little, don't rub them, just blink the water out. But practice right from the start keeping them open.
Some people find it helpful to wear goggles when swimming.
This will keep the water from burning your eyes, and make it easier to see. If you should get water up your nose by accident, don't panic. Put your head in the water, and gently blow the water out. It is important to learn to breath correctly when swimming. An easy way to do this is to stand in water about chest deep.