The Voyager Attitude and Articulation Control Subsystem uses a sun sensor to point the high-gain antenna at the sun. This is simple: rotate the spacecraft until you find the brightest spot in the sky.
When this is done, the spacecraft's attitude is known in two of the three axes (X and Y). To fix the third axis (Z), the spacecraft rotates until its star tracker finds a star of a specified brightness. This third axis fix is needed because you want to be able to point the camera platform in the correct direction.
On Voyager 1, one of the star trackers failed. The failure analysis showed that components in the star tracker failed though a combination of manufacturing error and radiation. As a result, the star tracker reported an incorrect position, and the antenna wasn't pointed at Earth even though the spacecraft thought it was. Despite the link mentioned in the comments, the tracker did not lock onto the wrong star.
This was a pretty good solution given the limitations the Voyager team had to work with. They reduced their problem to finding a star of a specific brightness within a very narrow band of the sky, so they needed to store the brightness of just one star. The Voyager star tracking system used an analog computer, keeping this as simple as possible meant saving weight. Storing the position data of thousands of stars would have required carrying another tape recorder plus a digital computer to analyze the data.
Modern star trackers (e.g. Ball Aerospace, ESA) use a catalog that contains position data for several thousand stars. They check the relative position of a number of stars to eliminate errors. Here's a screenshot of a star tracking system on a high-altitude balloon:
From NASA's Space technology website: