How to cure your athlete's foot infection and keep it from coming back
I suffered from athlete's foot for most of my life after contracting it as a kid while my leg was in a cast for four weeks. I can still remember seeing chunks of skin flaking off my feet and legs when the cast was removed. And after that, if my socks got wet during the day, the itching would get insane in the evening and it would keep me up at night. I had to sleep with my feet sticking over the side of my bed because if they touched anything they would itch like crazy. And the skin on my feet would dry up and peel off in big pieces, and I'd get cracks between my toes where blood would ooze through and form scabs. Nice, huh?
Tinea pedis is typically caused by a fungus that was initially endemic only to Southeast Asia and in parts of Africa and Australia. Only the natives from these areas didn't seem to know about it. It wasn't until Europeans started colonizing these areas wearing shoes that completely enclosed their feet which provided a dark, warm, moist environment - perfect little fungal nurseries - that athlete's foot really took off. By foot. Literally. It took off to Europe and then spread everywhere else when soldiers returned home from the trenches in 1917.
This would seem to suggest a cure might be to wear sandals or to go barefoot. In my experience, once you have athlete's foot, wearing open footwear will make things worse because your feet will dry out and start cracking and bleeding.
The most recommended treatment is a twice a day application of an anti-fungal cream on the feet, once before putting socks on in the morning, and before going to bed.  You may want to wear socks to bed to keep the cream from getting on your sheets.
Try using a non-prescription topical cream or gel containing terbinafine, tolnaftate, or miconazole. Powders can be very messy to apply, as are sprays unless the spray pattern is focused on a small area. The most effective of these non-prescription treatments appears to be terbinafine and tolnaftate with cure rates of about 70% and 64% based on a review of various studies.  Terbinafine is more expensive, but results are seen in half the time compared to tolnaftate (2 weeks versus 4), so it may be cheaper in the long run. Miconazole has a lower cure rate of only 47%. Your success will depend mostly on how rigorously you adhere to the twice a day application schedule.
It is recommended that the treatment continue for a month (2 weeks for terbinafine) even though the symptoms disappear early on in order to completely eliminate the infection. Otherwise you can pretty much count on becoming re-infected. After two or three days things will get much better and you may get lazy about applying the cream, but you've got to keep this up or the infection may return.
One side effect that got me personally that I haven't seen documented is that the cream you put on your feet can migrate through your socks and down to the insoles of your shoes. In my case, terbinafine (or some other inactive ingredient in Lamisil) started leaching a blue dye out of my custom orthotics which turned the bottom of my feet a very light blue color and made my feet itch. After a couple of weeks of treatment, my feet showed no signs of fungus but they itched more than ever. Naturally, thinking I still had an infection, I continued to apply more cream everyday to get rid of the itching and, of course, the itching became more severe. I figured out what was happening after wrapping my orthotics with saran wrap.
Garlic, or more precisely, a compound found in garlic, ajoene, may be very effective. In one study, a 1% ajoene cream was found to be more effective than terbinafine.  Unfortunately, ajoene creams are not available commercially and do-it-yourself treatments using garlic can burn your skin in some cases.
There are a lot of other home remedies available that seem plausible, but little hard data in the form of clinical trials is available as far as I know. Many of home remedies involve soaking your feet twice a day in an anti-fungal solution for 20 or 30 minutes - a big time sink compared to applying a spray or cream. Even if we were to assume soaking was effective, and I suspect in some cases it probably is, will you have the patience to continue soaking your feet for an hour a day for a month after your symptoms disappear in order to save a whole 30 cents a day?
There is a particular non over-the-counter remedy, very dilute potassium permanganate dissolved in hot water, that is said to be very effective, but I suggest you avoid it unless 1) you are extremely careful to ensure it is dilute enough (because minor fungal infections are better to have than chemical burns), 2) you have the time and patience prepare a solution and soak your feet for 20 minutes twice a day for a month, and 3) you have some way of disposing of toxic waste, since the solution is a poison and shouldn't be dumped down drains or into the soil. 
Tea tree oil is somewhat effective but not as effective as the non-prescription drugs according to one study. 
If these recommended treatments are not effective or if you have an extensive infection, see a doctor because you may need a prescription creme such as econazole or nystatin or you may have a different problem such as eczema, psoriasis or perhaps even a tough yeast infection. If you have a particularly brutal infection with cracking and itching and the whole oozing blood thing, you almost certainly have a bacterial infection as well as fungal, and you should see a doctor.
 C. Robbins, Tinea Pedis, Medscape Reference
 T. Markova, What is the most effective treatment for tinea pedis (athlete’s foot)?, The Journal of Family Practice, Vol. 51, No. 1, Jan. 2002
 A. O'Connor, Remedies: Garlic for Athlete’s Foot, The New York Times, January 6, 2011
 S. Moore, What are the dangers of potassium permanganate?, Livestrong.com
 M. Tong, P. Altman, R. Barnetson, Tea tree oil in the treatment of tinea pedis, Australas J Dermatol, 1992;33(3):145-9.