Generally, these infections can be cleared up by using an antibiotic as directed by a doctor. If you get infections often, there may be an underlying cause within the urinary tract that may need to be tested by a urologist.
It may indeed require surgery, but your physician will likely prescribe you a course of antibiotic treatment for the immediate infection to see if your symptoms will lessen without surgery.