Rotate player in direction of camera

I know there are countless threads on this topic but after hours of research I haven’t found anything I need.
So I wanted to ask you, how can I rotate the player in the direction of the camera?

using RotateTowards the player rotates according to an angle in speed * time but each rotation angle is different from each other and therefore the step it performs means that sometimes the player does not get a complete rotation towards the camera.
so what I’m looking for is to instantly rotate the player in the direction of the camera when it moves

“precise I want the player to rotate only if the camera is at a different angle and when moved it goes in that direction”
not that by rotating the camera the player rotates simultaneously
this is my reference code.

            _xRotation += Mouse_X * sensX * Time.smoothDeltaTime;
            _yRotation += -Mouse_Y * sensY * Time.smoothDeltaTime;

            _yRotation = Mathf.Clamp(_yRotation, upperLimit, bottomLimit);

            Vector3 Direction = new Vector3(0, 0, -distance);
            Quaternion rotation = Quaternion.Euler(_yRotation, _xRotation, 0);
            _mainCamera.transform.position = lookPos + rotation * Direction;

            _mainCamera.transform.LookAt(lookPos);

            if (_inputManager.Move != Vector2.zero)
            {
                //I would like to get rid of all this code flow 
                Vector3 movement = new Vector3(_inputManager.Move.x, 0, _inputManager.Move.y);
                Vector3 camDirection = _mainCamera.transform.TransformDirection(movement);
                camDirection.y = 0;
                camDirection.Normalize();

                Vector3 desiredForward = Vector3.RotateTowards(transform.forward, camDirection, RotationSpeed * Time.smoothDeltaTime, 0f);
                transform.rotation = Quaternion.LookRotation(camDirection);
                //up to here
            }
        }

Hello
I am not sure if this helps but here is the code i used. pretty much when rotation the player you want the camera to move up and down only but when turning left to right you want the player to move as well. Under your player in the hierarchy add an empty object (as a child of player) and call it orientation. Ignore the wall run part they are just values for something else.

   [Header("Refrences")]
[SerializeField] WallRun wallRun;

[Header("Sens")]
public float sensX;
public float sensY;

public Transform orientation;

float xRotation;
float yRotation;

// Start is called before the first frame update
void Start()
{
    Cursor.lockState = CursorLockMode.Locked;
    Cursor.visible = false;
}

// Update is called once per frame
void Update()
{
    float mouseX = Input.GetAxisRaw("Mouse X") * Time.deltaTime * sensX;
    float mouseY = Input.GetAxisRaw("Mouse Y") * Time.deltaTime * sensY;

    yRotation += mouseX;
    xRotation -= mouseY;

    xRotation = Mathf.Clamp(xRotation, -90f, 90f);

    transform.rotation = Quaternion.Euler(xRotation, yRotation, wallRun.tilt);
    orientation.rotation = Quaternion.Euler(0, yRotation, 0);

Not sure if this will work but under your 7th line add

orientation.rotation = Quaternion.Euler(0, xRotation, 0);

and add a transform:

public Transform orientation;

Hope this helps! GL