Use the compass on iPhone
The Compass app shows you the direction iPhone is pointing, your current location, and elevation.

See your bearings, coordinates, and elevation
Your bearings, coordinates, and elevation are shown at the bottom of the screen.
For accurate bearings, hold iPhone flat to align the crosshairs at the center of the compass.
To lock your current direction, tap the compass dial.
A red band appears when you’re off course.
To open your location in Maps, tap the coordinates at the bottom of the screen.
Allow Compass to access your location
If Compass doesn’t see your location, make sure you’ve turned on Location Services.
Go to Settings
> Privacy > Location Services, then turn on Location Services.
Tap Compass, then tap While Using the App.
For more information, see Set which apps know your location on iPhone.
Important: The accuracy of the compass can be affected by magnetic or environmental interference; even the magnets in the iPhone EarPods can cause a deviation. Use the digital compass only for basic navigation assistance. Don’t rely on it to determine precise location, proximity, distance, or direction.