Autopilots can and do fail. A common problem is some kind of servo failure, either because of a bad motor or a bad connection. A position sensor can also fail, resulting in a loss of input data to the autopilot computer. Fortunately, autopilots for manned aircraft are designed as a failsafe -- that is, no failure in the automatic pilot can prevent effective employment of manual override. To override the autopilot, a crew member simply has to disengage the system, either by flipping a power switch or, if that doesn't work, by pulling the autopilot circuit breaker.
Some airplane crashes have been blamed on situations where pilots have failed to disengage the automatic flight control system. The pilots end up fighting the settings that the autopilot is administering, unable to figure out why the plane won't do what they're asking it to do. This is why flight instruction programs stress practicing for just such a scenario. Pilots must know how to use every feature of an AFCS, but they must also know how to turn it off and fly without it. They also have to adhere to a rigorous maintenance schedule to make sure all sensors and servos are in good working order. Any adjustments or fixes in key systems may require that the autopilot be tweaked. For example, a change made to gyro instruments will require realignment of the settings in the autopilot's computer.