Autopilot is an incredible investment for a long distance cruiser. The value of being able to let a machine guide your course is invaluable when it allows you to be free from the helm while on watch. Electronic or wind powered autopilots have one major flaw in their design: cost. Both types of units will cost several thousand dollars and require a lengthy installation process.
That being said, there is a cheaper alternative to autopilot: sail balance.
We have both, electronic and wind powered autopilots, and we still use this simple trick. When going to windward, simply lock the helm straight and trim the sails for a balanced close reach. The yacht will not be able to turn further into the wind as the sails will luff and stall, and if it falls off, the sails will bring it back up into the wind.
This trick will allow you to sail as fast and as close to the wind as possible without the cost or complexity of an autopilot system.
To recap, all you need to do is lock the helm straight, then trim your sails for close reach and be sure they are balanced. The yacht will then turn up into the wind and sail along on the most windward course that it can as quickly as it can.
Even with two types of autopilot systems, we still do this trick when beating to windward as it is the easiest to set and allows us to relax in the helm as the sails do all the work.