People sailed between islands since 50,000 BC to transport stones, animals, and seafood. On a historic day, one of them raised a piece of large cloth to the air and figured it pushed the raft. And voila! The sail was invented.
Earlier sails were square, and they were only good when the wind blew in your direction. Otherwise, the answer was to start rowing, and Romans and Egyptians forced slaves to do this job.
However, rowing a ship was too slow compared to sails. A Viking vessel could only travel at 3 knots using oars and 15 knots with the sail. Faster ships brought innumerable advantages, and over centuries they were made possible through triangular sails that can be adjusted to wind direction.