Just above the Volume button on the side of your iPad is a side button that can be moved up and down. This generally is used for the Mute function.
However it can be changed to become a Screen Rotation Lock.
As you may have found, when you are using the iPad laying down or sitting back, or just when it’s on your lap it’s very easy for the screen to rotate without warning or choice. Locking the screen rotation will stop this from happening.
To change the buttons function, just go into the Settings app and click General on the left side. Now you will see Use Side Switch to: where you have the two options to select either Mute or Lock Rotation. Tap Lock Rotation and you’re done. Close Settings.
Now you can simply use the side button to allow or stop the annoying rotation.