By enabling the switch ‘Lock’ in the settings you can lock the screen such that it does not rotate if you rotate your device.
To lock the screen in the desired orientation, you first disable ‘Lock’. Then you rotate your device to the desired orientation and enable ‘Lock’.
If the lock is disabled, and the screen does not rotate if you rotate your device, you should check the ‘Control Center’. Swipe down from the top-right corner of your screen to open Control Center. Tap the Orientation Lock button if it is enabled.