Fungus spores are everywhere, it's almost impossible to avoid contact. The good thing is that fungus is opportunistic. If you don't give it a home it won't grow.
Fungus loves warm dark damp environments. Make sure you dry well between your toes and it is best to wear socks in your shoes.
Take care to avoid damaging your nails. Loosened nails are a nice home for fungus. Wearing tight shoes or even pressure from poor foot mechanics (clawed toes/bunions) can cause nail damage. Once a nail is damaged the layers aren't tight and water can get in along with fungus spores and start to take over the nail.
Monitor your skin for itching, peeling or red spots. These are early signs of fungal infection. It's easier to treat when it's small.