Its no different than any other practice (or small business) really. You have a service to provide and you need to get the word out about that service.
So you market yourself to other physicians (i.e., PCPs) who might have patients with surgical issues. If you are a surgical sub specialist, you market yourself to anyone who might see patients with conditions you treat (i.e., CRS might visit with Gastroenterologists; Endocrine Surgeons might market to Endocrinologist; Plastic Surgeon to breast surgeons, general surgeons and dermatologists).
You take ED and Consult call for hospitals so when a patient presents with a surgical issue, or develops one while an inpatient, you are called to consult on the patient.
Finally, you market yourself to the wider general population with your website and any other form of advertising. Patients with a surgical need that doesn't require ED presentation or urgent hospital admission (i.e., a breast mass, non-incarcerated umbilical hernia) often find you via an internet search, or ads in local newspapers, or from a community health talk they heard you give and ask their PCP to refer them to you. Most patients prefer to select their own provider rather than be assigned to the "on call" surgeon, at least for non-urgent diseases.