Madrid has a well-connected public transportation system, including buses and a metro system that runs throughout the city. A 10-trip ticket for the metro costs €12.20, and a one-way bus ticket is about €1.50. Taxis are also available, with the average cost for a 10-minute ride being around €10-€15.
If you have more time, consider visiting other museums such as the Thyssen-Bornemisza Museum or the Archaeological Museum. If you have less time, skip the Palacio Real or the Museo Reina Sofia. Also, keep in mind that many attractions offer free admission on certain days, so it's worth checking online before you go.