Madrid runs one of Europe's great transport systems, and the part visitors under-use is the regional layer: the same tarjeta that rides the Metro rides commuter rail to a UNESCO university city, a royal garden town and a 1,200-metre mountain trailhead. Taxis are honest and cheap by capital standards; you'll still barely need one.
The entries below are the whole system in eight moves, each with the barrio or town it unlocks.
Twelve lines, ~€1.50–2 a ride with the Multi card, runs to 1:30am. Line 1 strings Sol, Gran Vía's edge and Lavapiés; you'll rarely wait four minutes.
L8 metro to Nuevos Ministerios (fast, €3 supplement), Cercanías C-1 direct to Atocha from T4 (usually easiest with luggage), or the 24-hour Exprés bus to Cibeles.
The trains that make Cervantes' city an effortless overnight — from Atocha or Chamartín, storks guaranteed.
Atocha to the royal gardens; in season the vintage Tren de la Fresa does it with strawberries and costumed hostesses.
The C-8 reaches Cercedilla's trailheads; the narrow C-9 climbs on to Puerto de Navacerrada and Cotos. Europe's cheapest mountain railway, essentially.
661/664 to El Escorial, 691 to Navacerrada, 724 to Manzanares, 191 to Buitrago, 197 to Patones, 337 to Chinchón — the pueblos without a car.
Sol to the Prado is 15 minutes, to La Latina 12, to Malasaña 15 — central Madrid is smaller than its map suggests and mostly pleasant underfoot.
Metered, honest, ~€8–12 across the centre; a fixed €33 airport flat rate. Free Now and the apps work everywhere; night buses fan from Cibeles if you'd rather not.