Monks are human beings so they do get ill. They cure themselves with medicine and other medical procedures used by humans. The medicine is usually provided by the lay supporters or relatives. There are rules in the Vinaya about what type of medicine they can use, how long can they store them etc. For more details, click here.
I’ve come across this video where Bhante gave answers to heathcare questions. Hope you’ll find it useful.