How to clamp x rotation?

Hi so im creating a first person game but the camera can do a full circle on the x rotation and it looks weird while your playing. How do you clamp it between -90 and 90? This is my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RotateCameraY : MonoBehaviour
{
float rotationSpeed = 600f;

// Update is called once per frame
void Update()
{
    float mouseYInput = Input.GetAxis("Mouse Y");

    transform.Rotate(Vector3.left * mouseYInput * rotationSpeed * Time.deltaTime);

    Vector3 eulerAngles = transform.eulerAngles;
    eulerAngles.z = 0;
}

}
If it looks weird for a first person camera its cause i did it myself. Pls help

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RotateCameraY : MonoBehaviour
{
    float rotationSpeed = 600f;
    float maxRotation = 90f;
    float minRotation = -90f;

    void Update()
    {
        float mouseYInput = Input.GetAxis("Mouse Y");

        // Apply the rotation
        transform.Rotate(Vector3.left * mouseYInput * rotationSpeed * Time.deltaTime);

        // Get the current rotation angles
        Vector3 eulerAngles = transform.eulerAngles;

        // Clamp the rotation on the x-axis
        eulerAngles.x = Mathf.Clamp(eulerAngles.x, minRotation, maxRotation);

        // Apply the clamped rotation
        transform.eulerAngles = eulerAngles;
    }
}