During my 40s, while still in a marriage that had faded during my 30s, I lost interest in... well... everything really.
Piled on a ton of weight (topped out at around 290 pounds or so)
Then had a health scare - My sister, who is younger than me had a stroke, directly caused by high blood pressure - It runs in my family so I got checked, and my numbers were astronomically high - Doc said I was on the verge of a massive coronary.
I was eating TONS of sugary crap - Choccy bars, cake, biscuits, etc. and drinking full-sugar Coke/Pepsi/Fanta/etc... by the gallon.
So I went on a crash diet, and had a re-think of life in general, which prompted me to also get divorced.
At the time I was suffering from several of the effects that derby1 described above:
Not full-on ED, but had no desire to initiate sex - Rubbery when erect - Erection would deflate easily, and struggled to stay erect long enough to finish - Noticeably smaller than its usual size from years ago - Morning glories had stopped happening....
My diet was to cut out refined sugars as completely as I could - eat more fresh fruit - and drink only water, sugar-free, or fruit juice.
Lost around 95 pounds over the next 9-10 months... but the big revelation for me was finding out just how much lag effect that sugar had been having.
Not just the weight loss... Benefits also were better motivation, I started looking younger, even my original hair colour gradually came back - after going grey in my 40s (Even my Doc couldn't explain that one)
And best of all - the fella in my pants returned to his former self - Appetite for sex came back, Morning wood came back with a vengeance, Size and rigidity back to the levels I had in my 20s - And I no longer require any 'down-time' after climax (much to the surprise and pleasure, of women) It stays ready for as long as I want, or until I go to sleep.
The benefits of removing refined sugars from my diet, and replacing with fresh fruit/juice, have been immense - especially with regards to avoiding/fixing ED.