Rotating object with the mouse

So i’m basically making a small tank game and i want the turret of the tank to rotate with the mouse just like in World of Tanks but i can’t figure out how to do it.
I have tried myself but it failed completely so i took this code thinking it would work but indeed of doing what i want it to do, it just moves the turret inside the bottom of the tank clipping through it upside down.
public Camera camera;
public float speed;

private Vector3 mousePosition;
private Vector3 direction;
private float distanceFromObject;

void FixedUpdate()
    {
        mousePosition = camera.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, Input.mousePosition.z - camera.transform.position.z));

        GetComponent<Rigidbody>().transform.eulerAngles = new Vector3(0, 0, Mathf.Atan2((mousePosition.y - transform.position.y), (mousePosition.x - transform.position.x)) * Mathf.Rad2Deg - 90);

        distanceFromObject = (Input.mousePosition - camera.WorldToScreenPoint(transform.position)).magnitude;

        GetComponent<Rigidbody>().AddForce(direction * speed * distanceFromObject * Time.deltaTime);
    }

So does anyone know how i can make the turret rotate with the mouse position just like in World of tanks?

This gives you the direction from the tank to the mouse

Vector3 m_TankPos = Camera.main.WorldToScreenPoint(transform.position);
        Vector3 m_MouseDirection = Input.mousePosition;
        m_MouseDirection.x = m_MouseDirection.x - m_TankPos.x;
        m_MouseDirection.y = m_MouseDirection.y - m_TankPos.y;
        m_MouseDirection.Normalize();

        float m_Angle = Mathf.Atan2(-m_MouseDirection.y, m_MouseDirection.x) * Mathf.Rad2Deg;

        GetComponent<Rigidbody>().MoveRotation(Quaternion.Euler(new Vector3(0, m_Angle - 180, 0)));