context: Your lifestyle can affect how well your immune system can protect you from germs, viruses, and chronic illness. var s_context; s_context= s_context || {}; s_context['wb.modimp'] = 'vidfloat'; if(webmd.useragent && webmd.useragent.ua.type === 'desktop'){ webmd.ads2.disable Initial Load(); webmd.ads2.disable Ads Init = true; $(function() { webmd.p.pim.increment(); $('.responsive-video-container').insert After('.module-social-share-container'); require(['video2/1/responsive-player/video-loader'], function(video Loader) { video Loader.init({ autoplay: webmd.useragent.ua.type === 'desktop' && ! !s_sensitive, chron ID: $('article embeded_module[type=video][align=top]:eq(0)').attr('chronic_id'), continuous Play: true, cp Options: { flyout: true }, display Ads: true, mode: 'in-article', sticky: true }) }); }); } else { $(function(){ $('.responsive-video-container').remove(); }); } Replacing bad health habits with good ones can help keep your immune system healthy. Check this list to see where you could use some improvement. You may have noticed you're more likely to catch a cold or other infection when you're not getting enough sleep. Studies help bear out that well-rested people who received the flu vaccine developed stronger protection against the illness. Not getting enough sleep can lead to higher levels of a stress hormone. It may also lead to more inflammation in your body. Although researchers aren't exactly sure how sleep boosts the immune system, it's clear that getting enough - usually 7 to 9 hours for an adult - is key for good health. Try to get regular, moderate exercise, like a daily 30-minute walk. It can help your immune system fight infection. If you don't exercise regularly, you're more likely to get colds, for example, than someone who does. Exercise can also boost your body's feel-good chemicals and help you sleep better. Both of those are good for your immune system. Eating or drinking too much sugar curbs immune system cells that attack bacteria. This effect lasts for at least a few hours after downing a couple of sugary drinks. Eat more fruits and vegetables, which are rich in nutrients like vitamins C and E, plus beta-carotene and zinc. Go for a wide variety of brightly colored fruits and vegetables, including berries, citrus fruits, kiwi, apples, red grapes, kale, onions, spinach, sweet potatoes, and carrots. Other foods particularly good for your immune system include fresh garlic, which may help fight viruses and bacteria, and old-fashioned chicken soup. If you do come down with a cold or the flu, a bowl of chicken soup can help you get well faster, one study shows. Some mushroom varieties -- such as shiitake -- may also help your immune system. Everyone has some stress; it's part of life. If stress drags on for a long time, it makes you more vulnerable to illness, from colds to serious diseases. Chronic stress exposes your body to a steady stream of stress hormones that suppress the immune system. You may not be able to get rid of your stress, but you can get better at managing it. Learn to meditate. Slow down. Connect with other people. Work out to blow off steam. Counseling is a big help, too. Easing stress lowers levels of a stress hormone. It also helps you sleep better, which improves immune function. People who meditate regularly may have healthier immune system responses, some studies show. In one experiment, people who meditated over an 8-week period made more antibodies to a flu vaccine than people who didn't meditate. And they still showed an increased immune system response 4 months later. Having strong relationships and a good social network is good for you. People who feel connected to friends - whether it's a few close friends or a large group - have stronger immunity than those who feel alone, studies show. In one study, lonely freshmen had a weaker immune response to a flu vaccine than those who felt connected to others. Although there are many other things that affect your health, making meaningful connections with people is always a good idea. Laughing is good for you. It curbs the levels of stress hormones in your body and boosts a type of white blood cell that fights infection. Just anticipating a funny event can have a positive effect on your immune system. In one study, men were told 3 days in advance that they were going to watch a funny video. Their levels of stress hormones dropped.