Kick these surprising habits to the curb—and keep colds, flu, and other bugs at bay

Staying healthy isn't just about using hand sanitizer and avoiding coughing co-workers. It turns out some pretty surprising daily habits—like how you fight with your husband or whether you stay up late for Letterman—can impact how well your body fends off colds and flu. Check out these 10 habits that aren't doing your immune system any favors, and what to do instead.

Research shows that the fewer human connections we have at home, at work, and in the community, the more likely we are to get sick, flood our brains with anxiety-causing chemicals, and live shorter lives than our more sociable peers. In one study, researchers who monitored 276 people between the ages of 18 and 55 found that those who had 6 or more connections were four times better at fighting off the viruses that cause colds than those with fewer friends.

What to do: Don't let a jam-packed workday or hectic schedule get in the way of your friendships. Stop by a co-worker's office for a quick catch-up and or e-mail or text your friends at night to stay in touch when you're too busy for phone calls.

The perfect example: college students who get sick after pulling all-nighters cramming for exams. Poor sleep is associated with lower immune system function and reduced numbers of killer cells that fight germs. In fact, University of Chicago researchers found that men who slept only four hours a night for one week produced half the amount of flu-fighting antibodies in their blood (jump-started by a flu shot) compared with those who slept 7½ to 8½ hours.

What to do: Most adults need between 7 and 9 hours of uninterrupted rest every night, but how you feel in the morning and throughout the day may be a better gauge. If you're tired when you wake up in the morning, you're not getting enough—sleep, or maybe not enough quality sleep. (Do you wake up multipe times a night? Here's help.)

Studies show that glass-half-empty types don't live as long as those who look on the bright side.

When pessimists put a more positive spin on the calamities in their lives, they have less stress and better health. A classic UCLA study found that law students who began their first semester optimistic about the experience had more helper T cells mid semester, which can amplify the immune response, and more powerful natural killer cells, than students who had a more pessimistic perspective. One reason could be that optimists take better care of themselves. It could also be due to less stress-related damage to the immune system, such as killer cells that suddenly become pacifists.

What to do: Look for reasons—however small—to feel lucky every day. Sounds hokey, but try striking up a dinner table conversation with your family where you all share a couple of good things that happened every day. (Try these 3 simple ways to be more optimistic.)

They asked 41 happy couples to discuss a problem in their marriage for 15 minutes. The researchers detected surges in blood pressure, heart rate, and immune-related white blood cells, all of which were similar to the benefits seen with moderate exercise. But you still have to play nice: Couples who frequently use sarcasm, insults, and put-downs have fewer virus-fighting natural killer cells, have higher levels of stress hormones, and take up to 40% longer to recover from injuries than those who manage to stay positive and affectionate during their quarrels.

What to do: Don't keep what's bothering you bottled up. People with type D personalies—those who keep their opinions and emotions hidden—have killer T cells that are less active than those found in more expressive peers.

Chronic stress—the day-after-day kind you experience over job insecurity or a sick relative—takes a toll on many aspects of your health, including immunity.

There is compelling scientific evidence that this kind of stress (as opposed to the every-now-and-again kind from a bad day at work or a screaming match with your kid) causes a measurable decline in the immune system's ability to fight disease. Periods of extreme stress can result in a lower natural killer cell count, sluggish killer T cells, and diminished macrophage activity that can amplify the immune response. In fact, widows and widowers are much more likely to get sick during the first year after their spouse dies than their peers who have not experienced a major loss.

What to do: We're not going to tell you to take a bath or light a scented candle (unless those really help you relax, that is!). Do find go-to, healthy stress relievers that can take the edge off—be it a long run on the treadmill, a relaxing yoga class, or baking dessert just for fun. The important thing is that you unwind and recover from stress, since it's often hard to avoid in the first place. (Find more ways to calm down with these 2-minute stress solutions.)

Having your own supply of dime-a-dozen plastic ballpoints might just keep you from picking up a virus.

Cold and flu germs are easily passed through hand-to-hand contact, says Neil Schachter, MD, a professor of pulmonary medicine at Mount Sinai School of Medicine and author of The Good Doctor's Guide to Colds and Flu. Any way you can avoid touching public objects—such as the communal pen at the bank—will cut your risk.

What to do: "When you get up in the morning, don't leave the house without a pen in your pocket or your purse," Dr. Schachter suggests. "Take your own wherever you go, and use it instead of the doctor’s, the delivery guy’s, or the restaurant waiter's."

We don't need to tell you that puffing cigarettes is terrible for the entire body. But the secondhand kind is almost as harmful.

Each year, because of exposure to tobacco smoke, an estimated 3,000 nonsmoking Americans die of lung cancer and 300,000 children suffer from lower respiratory-tract infections. Secondhand smoke can trigger an asthma attack and aggravate symptoms in people with allergies. In addition, tobacco smoke has been shown to make asthma worse in preschool children and may even cause it.

What to do: Sounds obvious, but avoid secondhand smoke as much as you can—including spending time with people while they smoke. Encourage anyone in your everyday life (husband, coworkers, or neighbor friends) to quit.

Taking antibiotics at the first sign of a sniffle can make you resistant to these drugs over time, causing more serious infections.

Researchers found that certain patients taking antibiotics had reduced levels of cytokines, the hormone messengers of the immune system. When your immune system is suppressed, you're more likely to develop resistant bacteria or become sick in the future.

What to do: Take antibiotics only for bacterial infections, use them right away, and take the entire course. Don't use antibiotics preventively unless prescribed by your doctor, and don't save or share unfinished courses. (And of course, there are the antibiotics you're getting through meat. Here's what you need to know.)

Researchers have found that the positive emotions associated with laughter decrease stress hormones and increase certain immune cells while activating others. In a study conducted at Loma Linda University School of Medicine, healthy adults who watched a funny video for an hour had significant increases in immune system activity.

What to do: Um, laugh more. You know how: Watch your favorite comedies, have lunch with a pal known for her funny bone, and read those silly forwards from friends before you auto-click "delete."