A hydrocele that doesn’t disappear on its own might need to be surgically removed, typically as an outpatient procedure. The surgery to remove a hydrocele (hydrocelectomy) can be done under general or regional anesthesia. An incision is made in the scrotum or lower abdomen to remove the hydrocele.
https://www.mayoclinic.org/diseases-conditions/hydrocele/diagnosis-treatment/drc-20363971

