It was caused by constant immersion, unsanitary conditions and the inability to regulary change your footware.
I think that the only reason trench foot can kill is if the soldier has their foot amputated and then during the process get an infection.
They stayed out of water But they also were told to change their socks regularly , wear waterproof footwear or gumboots and cover their feet with whale oil .
rub feet with whale oil, wrap sheep skin around feet,didn't take their shoes off,encase feet in water
wear really big boots