Changing characterController to Local Axis

I am trying to make a 3d movement script and whenever I add a character controller it changes from using local to gloabl axis. where is my code

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour

{

    CharacterController characterController;

    public float jumpSpeed = 8.0f;

    public float gravity = 20.0f;

    public float speed = 9.0f;

    private Vector3 moveDirection = Vector3.zero;

    private void Start()

    {

        characterController = GetComponent<CharacterController>();

    }

    void Update()

    {

        var horizontal = Input.GetAxis("Horizontal");

        var vertical = Input.GetAxis("Vertical");

        transform.Translate(new Vector3(horizontal, 0, vertical) * (speed * Time.deltaTime));

        if (characterController.isGrounded)

        {

            moveDirection = new Vector3(Input.GetAxis("Horizontal"), 0.0f, Input.GetAxis("Vertical"));
            moveDirection.y = 0;
            moveDirection *= speed;

            if (Input.GetButton("Jump"))

            {

                moveDirection.y = jumpSpeed;

            }

        }

        moveDirection.y -= gravity * Time.deltaTime;

        characterController.Move(moveDirection * Time.deltaTime);

    }

}

You’re moving with both the character controller component and via translate?

You should only be moving via one method. Either transforms, character controller, or rigidbodies. You’ll need to pick to one and stick with it.

So how would I fix my code without just breaking it?