People with certain underlying or pre-existing conditions, including cancer, diabetes, kidney disease, obesity, and heart disease, are more likely to experience severe complications from Covid-19 -- so they're strongly encouraged to get the vaccine.
In clinical trials, the Covid-19 vaccines "demonstrated similar safety and efficacy profiles in persons with some underlying medical conditions" as in patients without pre-existing conditions.
However, if you feel sick with a cold, fever, or other illness -- including Covid-19 -- immediately before a vaccination appointment, the Centers for Disease Control and Prevention (CDC) recommends that you should postpone your vaccination until you feel better.