Take off your toenail polish if you notice dark spots on your nails. Buff your toes with a nail buffer and assess. It's possible that you've had a false alarm and your dark toenails are just stained from a dark nail polish. If this is the case, the discoloration will go away when you buff.
See your doctor if your toenails are not a pretty sight and are not only dark, but thick and crumbly like you'd imagine an ogre's nails to be. The final word about toenails given by a medical professional is your best bet instead of trying to self-diagnose the problem.
Take anti-fungal medications prescribed by your doctor. It's easy, you'll just need to pop a pill once or twice a day. Keep up with the routine as long as your doctor tells you to, even if your toes are looking more human before your script runs out.
Paint your nails with a special medication that gets rid of the infection. Administer your medicated pedicure every day for a week, then remove all of the medicine with alcohol wipes and start over. Your doctor will tell you how long to keep up this practice; some people need to use the topical medications for months to stay infection-free.
Keep your feet dry at all costs. Towel off well after a shower or a run and wear cotton socks to soak up any excess moisture that can lurk in dark corners and turn into a nail infection. This is important while you're treating your dark toenails, as moisture can impede healing.