It is about a 45 minute ride to downtown by the Blue Line. Follow the directions for trains to the city and hop on a train. It costs $2 per ride or you can buy a one day pass for $5 at either transitchicago.com or at O'Hare. Get off at Washington and you are in the Loop or transfer to the Red Line at Washington and ride the Red Line north a few stops to the Chicago stop (State and Chicago) and enjoy the shopping of the Mag Mile (one full block East of State is Michigan). You can also get a ride up to the top of the John Hancock building there.
Might as well enjoy the city for a couple hours if you are stuck at O'Hare for 6 hrs.
Just allow an extra 15 min or so to return as the trains can run slowly for a stretch along the Kennedy due to construction work.