Both destinations are served by Peelamedu (CJB). Since there's no flight route between them, the best way to travel is by road.
Coimbatore
Fly to Peelamedu (CJB), then travel by road to Coimbatore. Taxis, buses, and private cabs are available from the airport.
Ooty
Fly to Coimbatore (CJB), then travel by road to Ooty. Local transport options include taxis, auto-rickshaws, and state buses.