This article explains how to use the compass and level on your iPhone. Instructions apply to iPhones running iOS 12 and iOS 11, except where noted.
How to Use the Compass App on Your iPhone
To access the compass, open the Compass app, which comes standard on all current iPhone models. The application is located on the iPhone's home screen, but if you've deleted it, you can reinstall it for free from the App Store.
When the app is opened for the first time, you will be prompted to calibrate the compass by rotating the phone 360 degrees. Follow the animation on the screen to assist the calibration process. After the device is calibrated, the compass screen will be displayed.
Hold your iPhone parallel to the ground with the screen facing up. In the center of the compass is a small circle with a crosshair in the middle. To make sure the phone is parallel to the ground, tilt the phone to align the crosshair with the center of the compass.