Travel insurance may cover you if you’re unable to travel. If you fall ill unexpectedly or you become injured and therefore cannot travel, usually, your travel insurance will cover the expenses of the cancelled holiday.
If the illness is due to a pre-existing medical condition that you were aware of before booking the holiday, then cover is unlikely. Likewise, this policy will likely not cover any treatment of an injury or illness that started before your trip began.