As a teen I was struggling with athlete's foot. Over-the-counter creams helped only temporarily, wherever I stopped using them, the problem came back. The permanent solution I discovered was vinegar. Soaking my feet in diluted vinegar (1:1 vinegar to water, if I recall correctly) for half an hour a day healed the condition. I don't remember how long it took. I would guess a month or so. It definitely depends on the severity of the problem. I'm not sure if this method works for nail fungus, these are much more resilient unfortunately.
I also noticed that exposing your feet to alternately hot and cold water helps, as it improves circulation.
I would look out for sugar consumption. It definitely plays a huge role. As @Michael569 mentioned, the overall immunity might be at play here too.