Check out example codes for "how to clamp transform.rotation". It will help you in understanding the concepts better.
Code Example 1
headRotation = Input.GetAxis("Mouse Y") * speed;
transform.Rotate(0, 0, -headRotation, Space.Self);
transform.eulerAngles.y = Mathf.Clamp(transform.eulerAngles.y, -90, 90);
Learn ReactJs, React Native from akashmittal.com