Madrid is a huge metropolitan city, just like New York. Because of that, transportation is very similar to that in New York... but there are definitely more electric scooters!
People get around in Madrid by taking the bus, train or railway. What's interesting about the public transportation system is that anybody under 25 can get a refillable metro card and only be charged 20 euros a month! This is called a youth card, and it can get you anywhere in Madrid. The intercity railway system is similar to Amtrack, and there are also buses that take you to other cities or even countries! These buses aren't part of the public transportation but rather belong to private transportation companies.
In Spain, there are also a ton of electric scooters! I've found that they're really fun and an affordable and quick way to get places. I've also used Uber and Cabify, which is an app-based system like Uber, to get around when it was late because trains in Madrid stop running at 1:30 a.m.! People also drive a lot in Madrid, but I don't know much about this since I still can't drive.