Most aircraft have a GPS on the panel that can show you the airspace around you and along your flight path, but it's not a required instrument. It's more of a 2D depiction of the airspaces, but there are three dimensional depictions on them. There's also apps like ForeFlight and Garmin Pilot that you can run on a tablet or phone.
Before those electronic methods became ubiquitous pilots used paper charts and references and used ground references, pilotage and navigation aids to determine their position on that paper map. For instance, here's the complex airspace around the aircraft owner's home airport. https://skyvector.com/?ll=33.897663018511054,-117.6024627647...