Perhaps the first thing you will be asking yourself before to Madrid is how to get from the airport to the centre of Madrid. There are a few options, and other than taking a taxi, are all very cheap!
Metro: Line 8 links the four airport terminals to Nuevos Ministerios metro. There airport has two metro stations; one for terminals 1,2,3 and a separate one for terminal 4- note there is another metro station between the two. From there you can take L6 or 10 to continue your journey. For most people unfortunately this means they might have to change a couple of times, which might be a hassle with luggage- it's not very direct to the centre on the metro. The journey is 2,50€, which includes the airport supplement and takes around 40-45 minutes.
Bus: There is a 24 hour bus service connecting the airport to the city centre. The bus leaves every 20 minutes during the day, and after 11pm at 25-35 minute intervals. You can take the bus from outside the arrivals of each terminal (lowest floor), where it will take you directly to the centre, stopping at O'Donnell, Plaza de Cibeles and Atocha Renfe railway station. All of these stops connect with the metro and other bus lines. For example, if you are staying near Ópera, you could get off at Cibeles and take line 2 from Banco de España, which is just next to rthe bus stop. After midnight the bus terminates at and leaves from Plaza de Cibeles- Atocha is not served. The journey takes 40 minutes and costs 2€. The buses are easy to spot as they are painted bright yellow. For more details see the Exprés Aeropuerto page on the EMT website.
Cercanías trains: These trains are local trains and serve the city and surrounding towns and it might be easier to take one of these you are staying within a short walk of Sol or Atocha stations, or taking a train to another city. You could take the metro to Nuevos Ministerios and then catch a train heading to the centre. The journey is very fast- only 3 minutes to Sol. It might cost slightly more than the metro but it is worth it if you have lots of suitcases. Journey time- around 30 mins. The airport should be connected to the cercanías within a year or two which will speed things up.
Taxi: A taxi to the centre will cost around 30€ including supplements, although it will more at night, weekends or on public holidays. From the airport only take official taxis from the taxi stands. Journey time to the centre- around 25-30mins.