You can buy a boat after you arrive to New Ashos, in the harbor (M36:4). There you will encounter a guard, who you've beaten while escaping from the prison. You can ask him about controlling a boat.
At the mini-map, the wind direction is marked (blue arrows). You need to set the sail (W and S keys) so that the sail catches wind. The sail should be set at an acute angle relative to the mast. To sail faster, it is best to set the sail perpendicular to the direction of the wind. Red weather vane on the top of the mast shows the resultant force with which the wind drives the boat.
Sailing against the wind is extremely difficult. The only way is sailing zigzag and moving the rudder to catch the wind side. Despite this, the speed of the boat will be drastically limited, waiting for favorable weather is a far better idea.