There are a bunch of different nautical terms for the relation of your ship to the wind, but in non-nautical geek terms: the best approach is to try and cut diagonally into the wind, and as Doomboy mentioned, cut back diagonally as you sort of crisscross your way towards your desired point (tacking). It's painful and slow for many of the ships in the game, but it's a lot better than just sailing straight into the wind. I didn't have the patience to tack in Pirates, so I normally just found something to do wherever the wind took me.
As illogical as this sounds, some ships actually travel faster with the wind at an angle behind their masts, rather than directly behind the ships angle of travel. That's as nerdy as I'm going to get