Depends on the problem.
The most usual repair is to re-collimate - the lens is adjusted to focus correctly at infinty, all the elements are generally re-aligned.
Some AF-S / USM / HSM lenses can have their motors adjusted to fix focus problems. Sigma UK call this "a modified circuit", they can make one for your particualar camera body for some lenses (aka firmware)
In Nikon land, an AF-D lens cannot be caliberated like an AF-S lens. Its possible to fix small focus errors with "shims", generally these can't be caliberated for focus errors. They can be fixed with optical errors by re-collimation.
It really depends on the fault.