A pic might help. Shot from above, maybe even the fish out of the water.
I just looked in my veterinary text book of fish diseases, under the topic ulceration.
There were about a dozen causes, each with its own treatment
It could be bacterial (Aeromones, and Pseudomonus are common) requiring antibiotics (one if for gram neg bacteria, another if for gram pos).
Or... a nematodal parasite such as Camallanus requiring a anti-wormer medication like Levamasol
Or... anchor worm (not actually a worm), but a crustacean requiring a medication with a chitin inhibitor.
To answer a question like yours properly, many more specific details are needed.
Beside the pic of the infected areas, water parameters can be helpful.