Despite continual advances in medical technology and widespread use of drugs to treat various ailments, the best way to avoid most illness, overall, is to eat healthfully. Naturally a good diet will not prevent you from breaking your leg, but it may stand you in good stead from the point of view of your bones healing more quickly, and reduce the chances of infection. Moreover, people who eat well tend to maintain a good weight, and to have more energy and motivation than those who consume mainly junk.
If you are used to grabbing a high-calorie coffee from a coffee bar instead of breakfast, snacking on chocolate mid-morning, eating a ham sandwich on white bread at lunch, and then heating a ready-made boxed meal for dinner, you cannot expect good health. Your body will be missing a lot of nutrients that don't exist in pre-packaged pre-processed 'food'. Either your body will crave what you are missing, leading you to over-eat and thus gain weight, or you will gradually find that your health becomes poor, and you may succumb to serious illness.
It is true that some people seem to cope better with junk food than others, and you will not necessarily see problems quickly; but just a heavy smoker will almost certainly suffer some lung damage and other long-term effects of the habit, so a junk-food eater will sooner or later discover that the body simply is not designed to function on minimal nutrition, any more than a car can run on poor-quality fuel.
Having said that, no two people have exactly the same metabolism. One person may thrive on a fully vegetarian diet, while another lacks energy without some form of meat. One person enjoys and benefits from dairy products or wheat, another suffers allergies or intolerances. Each individual should learn to listen to his or her own body, to stop eating when they have had sufficient, and to avoid whatever causes discomfort or pain. In general small, regular meals and snacks are better than one or two large ones per day, eating slowly helps digestion better than eating rapidly, and enjoying a meal relaxing with friends is preferable to a tense meal with arguments.
Several foods are described on this site, with possible health benefits; but please do not take this as medical advice. If you react badly to a particular food, or intensely dislike it, it is best to avoid it no matter what the potential benefits might be. On the other hand, if you are used to additive-laden processed products, you might find that real food tastes bland at first; if so, it is worth continuing until you can appreciate the subtler flavours of food as it is supposed to taste.