How do commercial airlines prepare for pilots falling sick during the flight?
do they fly in a pilot (like mid-air refuel)?


No, that isn't really feasible!

See answers to Can a passenger jet be towed to safety if it breaks down in midair?




  do they leave it to the co-pilot to take care of such situations?


Yes. In both normal and emergency situations, the co-pilot is able to fly the aircraft, navigate to a nearby airport and land the aircraft without the assistance of the senior pilot.

From Skybrary


  Here are some lines of defense: 
  
  
  The remaining pilot must assume or maintain control 
  Establish a safe flight profile and engage the autopilot; use all possible automation 
  Obtain cabin crew assistance
  Inform ATC 
  If on an extended-range twin-engine operations (ETOPS)
  flight, the remaining pilot or PIC must assess whether to continue
  the flight, return to the departure airport or divert. The decision
  is based on: 
  
  
  Weather conditions at the destination or alternate
  Reduction of flight time if diverting 
  Workload involved in single-pilot operation 
  Familiarity with the alternate 
  Condition of the incapacitated pilot 
  Availability of medical assistance 
  Overall safety of the flight 
  
  Arrange medical assistance upon arrival 
  Brief a cabin crew member to assist if required 
  Complete the approach and landing using the autopilot as much as possible 
  A partially incapacitated pilot should not be allowed to participate in the    subsequent operation of the aircraft, as
  judgment may be impaired
  After landing, seek immediate medical assistance
  


See also IFALPA - Pilot Incapacitation


  The remaining pilot must first assume command and maintain control of the aircraft. Furthermore the position of essential controls
  and switches should be checked, and in nearly all cases, use of the autopilot should be made and an emergency be declared.
  Use of the autopilot and priority of air traffic service are two obvious and effective ways of maintaining a tolerable level of workload.
  
  The second step is to take care of the incapacitated flight crew member. The grounds for this are not entirely humanitarian; if left unattended an incapacitated pilot can become a major problem and in any case is a major distraction to the remaining crew. Thus
  the incapacitated pilot must be moved out of the range of flight controls. In all cases, the advisability of removing a pilot (perhaps unconscious) from the seat must be dictated by consideration of the phase of the flight, the crew available, and the contours of the
  flight deck.
  
  Note: Consideration of the restraint and care of an incapacitated pilot dictates that cabin attendants are at least familiar with the
  operation of harness and seat controls
  
  Finally, and after the incapacitated flight crew member has been taken care of, the remaining flight crew should re-organise the cockpit work and prepare for landing. Details will depend on many variables including such considerations as the type of aircraft being flown, phase of flight, en route and terminal weather, and many others.





  How does commercial airlines prepare themselves for these kind of situations.


I imagine that it involves the usual measures


make pilots take regular medical tests.
make pilots responsible for reporting own or crew illness, fatigue etc.
prevent pilots eating the same meals in-flight.
write procedures for pilot incapacitation in-flight.
train flight crew to perform those procedures
review and revise the above based on experience of relevant events.


From what I've read, non-pilot flight-crew are often given very basic training so that they understand the basics of flight. For example Transport Canada requires flight attendants initial training to include a pilot-incapacitation drill, an understanding of aircraft parts including rudder, ailerons etc, principles of flight, etc etc.


  Do they specifically check if there are any pilots in the passenger manifest


I believe the airline staff would often be aware of any airline pilots onboard (e.g. dead-heading crew) but not of GA or military pilots flying as normal passengers.