Although yeast and other fungi and bacteria are equal-opportunity nail invaders, it's more likely you'll develop a fungal infection in your toenails than your fingernails. This is generally because the fungus that causes an infection in a nail is the same as the one that causes athlete's foot. Athlete's foot is a common infection; it can develop quickly in warm, moist places, such as inside your socks.
To help prevent fungal infections from invading your nails, keep all nails and cuticles clean and dry with a baking soda scrub, don't bite your nails or pick at hangnails (which can open the door to a fungal or bacterial infection), and treat ingrown nails with saltwater soaks to keep them clean and infection-free.
If you have signs of a foot fungal infection, over-the-counter topical antifungal medications containing clotrimazole or miconazole can help clear it up, but if the infection gets into or under a nail, you may need prescription-strength medication to knock it out.