Biggest cause of foot odor is sweat, because of sweat it's easy for bacteria to grow and spread. Another cause is wearing socks or shoes that won't let your feet breathe. It's really important to frequently change your socks and shoes and also one of the most important things is to get socks that would allow your feet to "breathe".
There are available certain socks that are made to reduce sweating and smell. Most commonly socks are made of polyester which is not really recommended. Cotton socks on the other and are much more better. Wearing better socks doesn't cure foot odor but these do make you feel better.