My player is being pushed into the ground

I don’t know why but when i move my player also gets pushed into the ground.
How can I fix that?

using Unity.Cinemachine;
using UnityEngine;
using UnityEngine.UIElements;

public class movescript : MonoBehaviour
{
 
    public rotationscript rotationscript;
    public float catRotLocal;

    
    // Start is called once before the first execution of Update after the MonoBehaviour is created
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {

        if (Input.GetKey(KeyCode.W))
        {
            transform.Translate(rotationscript.orientation.forward * Time.deltaTime);//this was vector3.forward to move
        }

        if (Input.GetKey(KeyCode.A))
        {
            transform.Translate(rotationscript.orientation.forward * Time.deltaTime);
        }

        if (Input.GetKey(KeyCode.S))
        {
            transform.Translate(rotationscript.orientation.forward * Time.deltaTime);
        }
        if (Input.GetKey(KeyCode.D))
        {
            transform.Translate(rotationscript.orientation.forward * Time.deltaTime);
        }

        if (Input.GetKey(KeyCode.Space))
        {
            transform.Translate(Vector3.up * Time.deltaTime * 5);
        }

        if (Input.GetKey(KeyCode.R))
        {
            transform.Rotate(Vector3.up);
        }
    }    
}

using Unity.Cinemachine;
using UnityEngine;
using UnityEngine.UIElements;

public class rotationscript : MonoBehaviour
{
    [Header("References")]
    public Transform orientation;
    public Transform player;
    public Transform playerObj;
    public Rigidbody rb;
    public float rotationSpeed;
    public float x, y, z, yt;

    private void Start()
    {
        UnityEngine.Cursor.lockState = CursorLockMode.Locked;
        UnityEngine.Cursor.visible = false;
    }

    private void Update()
   {
        
        Vector3 viewDir = transform.position - new Vector3(transform.position.x, player.position.y, transform.position.z);
        orientation.forward = viewDir.normalized;

        float horizontalInput = Input.GetAxis("Horizontal");
        float verticalInput = Input.GetAxis("Vertical");
        Vector3 inputDir = orientation.forward * verticalInput + orientation.right * horizontalInput;

        if (inputDir != Vector3.zero)
            playerObj.forward = Vector3.Slerp(playerObj.forward, inputDir.normalized, Time.deltaTime * rotationSpeed);

        x = transform.position.x;
        y = player.position.y;
        z = transform.position.z;
        yt = transform.position.y;
    }
}

To move a rigidbody around you need to use AddForce or AddRelativeForce. Or if you don’t want any inertia then you can set the rigidbody’s velocity directly.

To rotate a rigidbody you can use AddTorque or MoveRotation.