How can a change in your surroundings prevent illness? I hear some people say that.

Yes. Many illnesses are associated with smoke, smog, stress, industrial waste, weather, crowding etc. If you have lllness associated with these factors, yo ucould change it by changing you surrounding appropriately.