How to limit the rotation of transform.Rotate Z

public class Rotate : MonoBehaviour {

float speed = 30.0f;

private void Update()
{
    float h = Input.GetAxis("Horizontal");

    h = h * speed * Time.deltaTime;

    transform.Rotate(Vector3.forward * h);

}

}

i want limit rotation Z of transform
help…

Look into the Unity scripting API for Mathf.Clamp here Unity - Scripting API: Mathf.Clamp

It is used to clamp something between a minimum and a maximum float value