Stop automatic rotation

Prevent screen from rotating

Open quick settings and turn Auto-rotate off.

In this mode, you can manually rotate the current app. Turn your phone the direction you want, then touch in the corner.

Allow screen to rotate

To allow rotation for all apps, open quick settings and turn Auto-rotate on.

You can also adjust this in Settings > Display > Auto-rotate screen.