45 year old. Has a swollen testacle. Doctors say it is hydrocele and surgery required. What is the risk of safe surgery?

Minimal risk. Go ahead and have the surgery. Use an ice pack & athletic/scrotal support after sugery and stay off your feet for a few days to have a speedier and more comfortable recovery. Good luck.
Minimal. I would say that this type of surgery is fairly quick and outpatient with minimal risk outside of anesthesia and minimal infection/ bleeding risk.
Safe. A hydrocele is a collection of fluid in the scrotum around the testicle, and are fairly common. In newborns they usually go away. If present in an adult, they are usually painless, but depending on the size may creat some discomfort. Surgery is the usual approach and is very safe and straightforward. As with all surgery, one has the risk of bleeding, blood clots, infection.