Cancer treatments can weaken the immune system, making the body more susceptible to infections. Preventive measures include good hygiene, avoiding crowds, and staying away from sick individuals. Prophylactic antibiotics and antiviral medications might be prescribed in some cases. Prompt treatment of any signs of infection is critical.