The Blue Line (or the L) can be picked up from terminals 1, 2, and 3. Follow signs posted that say "CTA trains" or "trains to the city". The L can take you downtown in about 45 minutes for around $5.
Taxi fare to the city from O'Hare is usually a minimum of $50 plus tip and takes about $35 minutes depending on traffic.
Midway International Airport
We would only recommend flying into Midway if you have a particular airline you need to use that can only be found there or for another specific reason. Public transportation from Midway is not recommended unless you are already familiar with the CTA system.