It is important to work with an experienced swimming instructor. Trying to learn on your own can be very dangerous. There are, however, some things you can work on out of the water. You can practice swimming strokes while lying on a bench, or on the beach. You can't swim safely if you cannot see where you are going.
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.