Infection control prevents the spread of diseases within a healthcare setting, safeguarding both patients and staff.