You can either take a cab for 20 - 30€ from the Airport to Atocha or Chamartin train stations, or you can take the metro (which I recommend) all the way to Colombia station, and then transfer to line 9 and in three stops you will be at Chamartin.