Any help with prevent camera from passing a specific coordinate?

I try to prevent my camera from moving for ever, so I want to add somthing like “borders”.
I tried this, but it gives me errors.
How should I fix it?

if(Camera.main.transform.position >= Vector3(worldBorderX, transform.position.y, transform.position.z))
{
    Camera.main.transform.position = Vector3(worldBorderX, transform.position.y, transform.position.z);
}

if(Camera.main.transform.position >= Vector3(transform.position.x, transform.position.y, worldBorderZ))
{
    Camera.main.transform.position = Vector3(transform.position.x, transform.position.y, worldBorderZ);
}

if(Camera.main.transform.position <= Vector3(-worldBorderX, transform.position.y, transform.position.z))
{
    Camera.main.transform.position = Vector3(-worldBorderX, transform.position.y, transform.position.z);
}

if(Camera.main.transform.position <= Vector3(transform.position.x, transform.position.y, -worldBorderZ))
{
    Camera.main.transform.position = Vector3(transform.position.x, transform.position.y, -worldBorderZ);
}

assuming you are using Javascript/UnityScript. You may also want to edit your original post and add the errors.

    if(Camera.main.transform.position.x >= worldBorderX)
    {
		Camera.main.transform.position.x = worldBorderX;
    }
     
    if(Camera.main.transform.position.z >= worldBorderZ)
    {
		Camera.main.transform.position.z = worldBorderZ;
    }
     
    if(Camera.main.transform.position.x <= -worldBorderX)
    {
		Camera.main.transform.position.x = -worldBorderX;
    }
     
    if(Camera.main.transform.position.z <=  -worldBorderZ)
    {
		Camera.main.transform.position.z = -worldBorderZ;
    }