The goal of surgery is to widen the opening of the tunnel so that the tendon can slide through it more easily. This is usually done on an outpatient basis, meaning you will not need to stay overnight at the hospital.
Most people are given an injection of local anesthesia to numb the hand for the procedure.
The surgery is performed through a small incision in the palm or sometimes with the tip of a needle. The tendon sheath tunnel is cut. When it heals back together, the sheath is looser and the tendon has more room to move through it.