Summarize this article:

Taking good care of your feet will lower the risk of getting a nail infection.  Using simple preventative measures will help you avoid ever having to deal with nail fungus in the first place.  Follow easy preventative measures to avoid nail fungus. Wear sandals or flip flops when in public areas.  Never go barefoot. Clean and wash your feet everyday. Having too much moisture or warmth, brought on by socks or shoes, can encourage nail fungus to grow.  Find shoes and socks that allow your feet to breathe.  You should also make sure that your socks are always clean as they can harbor fungal spores.  Make sure your shoes fit well and there is enough room for your toes. Discard old footwear that was worn while having an infection. Allowing this fungal infection to remain on your foot increases the risk of it spreading to your nails.  Stop the potential spread by treating athletes foot as soon as you can.  Mild cases of athletes foot can be treated with over-the-counter medications.  Difficult cases may require prescription strength medication. Ask your doctor which is right for you. Always keep your nails trimmed evenly and short.  Use a different pair of nail clippers for your infected nails and your healthy nails.  Using the same pair can spread the fungus to healthy nails. Clean and sterilize your nail clippers and files after use.
Practice basic hygiene and foot care. Keep your feet cool and dry. Treat athlete's foot immediately. Care for your nails.