Thyroid surgery is a procedure in which part or all of the thyroid gland is removed. This may be necessary if there is a thyroid nodule or cancer, an overactive thyroid gland, or an enlarged thyroid gland that is causing compression of nearby structures.