Think your sex life is foolproof? Think again — occasional erection problems can be triggered by anything from bedroom jitters to a night out boozing.

But for the 10 percent of men with long-term erectile dysfunction, could anything have been done to prevent the condition in the first place? Perhaps. To keep ED from striking, follow this step-by-step prevention guide.

  1. Kick the habit (no ifs, ands, or butts!). No. 1 on your ED prevention list? Stop smoking. For men under the age of 40, smoking is the biggest cause of erectile dysfunction. That’s because maintaining an erection requires a healthy blood supply, and nicotine causes your blood vessels to contract (which causes the penis to shrink). The longer you’re a smoker, the more difficult it is to treat or reverse erectile dysfunction.

    Need help quitting? We’ve nailed down the stop-smoking techniques that really work (and those that are just wastes of time and money): The Best and Worst Ways to Quit Smoking.

  2. Move more. Regular exercise is a must for both your heart and circulation — and because of that, it’s also an important way to prevent ED. Regular exercise can improve blood flow to the penis, as well as to the rest of your body. Not to mention, working out increases your energy, lowers blood pressure, reduces stress, helps you sleep better, and makes you feel (and look!) more attractive — which are all helpers in avoiding erection problems.
  3. Take it easy on the alcohol. Sure, kicking back with a little booze is a great way to de-stress — but in large amounts, alcohol is a depressant. That means the more you drink, the more likely the alcohol will lead to erectile dysfunction (depression is one of the biggest causes of ED). This effect increases as you get older, so older men who are at greater risk for erection problems should take steps to limit the number of alcoholic beverages they consume. Talk to your doctor to find out if you should aim for less than the two-drinks-per-day maximum that’s often advised for men.
  4. Eat these foods. A number of studies show that obesity, high cholesterol, diabetes, heart disease, and high blood pressure are linked to erectile dysfunction. Since a healthy diet is one of the best ways to protect against these diseases, it makes sense for your sexual health to eat healthily. What foods should be a part of your ED-prevention diet? Lots of fruits and vegetables, plenty of fiber, and very little saturated fat. If you’re struggling with your weight or cholesterol, ask your doctor for help.
  5. Protect your penis. Although the penis is not a bone, it can fracture. When the penile chamber that fills with blood during an erection ruptures, it fractures the penis — and this can be a major cause of erection problems. And if you don’t seek immediate treatment, penile fractures can lead to scarring, deformity, and erectile dysfunction. So think twice before having over-the-top, acrobatic sex (especially if the woman’s on top). If a penile injury occurs with bruising, pain, or swelling, call your doctor or go to an emergency room.
  6. Brush your teeth. Turns out, erectile dysfunction and chronic gum disease share many of the same risk factors. In one recent study, 80 percent of men who had severe erectile dysfunction (caused by poor penile blood supply) also had chronic gum disease. Keeping your mouth healthy with flossing, brushing, and regular dental visits is one more way to keep your sex life in tip-top shape.
  7. Kick your feet back. Stress and anxiety are frequent contributors to erection problems. That’s because stress causes your body to release stress hormones that are good for your "fight or flight" response, but bad for your blood flow because it causes blood vessels to contract. To prevent ED, find ways to reduce stress (without resorting to drugs, cigarettes, or alcohol, of course).
  8. Get your Zzzs. Fatigue can be a detriment your sex life — so getting plenty of rest before a romp in the hay is always a good idea. But if you’re struggling to get a good night’s sleep and feeling drained throughout the day, you could have a condition called sleep apnea (which is signaled by very noisy snoring and periods of interrupted breathing). Studies show that men with erectile dysfunction are more than twice as likely to have sleep apnea, so if your wife is sleeping in the other room because of your snoring, talk to your doctor.