Any guy can have an off day. Some afternoons your usually reliable golf swing might produce nothing but ugly slices that curl into the woods and plunk down in ponds. Likewise, it's perfectly normal to experience an occasional problem producing an erection. Maybe you were stressed out or tired. Or, hard as it may seem to believe, you just weren't in the mood.
On the other hand, some men develop temporary erectile dysfunction (ED) when they take certain medications. The list of potential culprits is long and includes drugs used to treat high blood pressure, heartburn, depression, pain, and other conditions. If you develop persistent erectile dysfunction while taking a medication your doctor may be able to switch you to a different drug.
Of course, erectile dysfunction can become chronic. The problem becomes more common as men age. But erectile dysfunction is not inevitable, and if it becomes an issue in your life, your doctor can recommend effective treatment.