While it may not always be preventable, adopting a healthy lifestyle can help reduce the risk of erectile dysfunction. Maintaining a balanced diet, regular exercise, avoiding smoking and excessive alcohol consumption, and managing stress can contribute to overall sexual health.