How is a discectomy done?

Variety of ways. Several ways but standard in the lower back is a microdisectomy through a small posterior incision leading to the roof or lamina of the spine where a small keyhole opening is created through a natural open area & moving the nerve & nerve sac out of the way to access the piece of disc herniated with special instruments to protect the neural elements while removing disc fragments as an outpatient.
Laminectomy. Most discectomies (lumbar) are performed through a laminectomy or laminotomy, when a posterior opening into the spinal canal is made to approach the disc. It can also be performed through approaches such as anterior (cervical), depending on the location of pathology. Percutaneous and/or endoscopic approaches can be done, usually for less severe pathology.