unity – How can I rotate the player only to -40 or -45 degrees?

float c = 0.0f;
private void FixedUpdate()
{
    if (startRotatingBack)
    {
        var p = transform.eulerAngles;

        if (p.y != -40)
        {
            p.y -= 1;
            transform.eulerAngles = p;
        }

        c = c + 0.1f;
        playerAnimator.SetFloat("Forward", c);
    }
}

The problem is that the transform keeps rotating nonstop.

Maybe the problem is with this chick?

if (p.y != -40)

I want to make that the player will rotate backward. -40 or -45 is good enough but the player the transform is keep rotating nonstop so it’s making circles instead of rotating once to -40 or to -45.

I tried also this way but it’s not working either :

if (!Mathf.Approximately(p.y, -40))