Apply acceleration and Decceleration to transform.forward?

Hello, I had been following the youtuber gamesplusjames 3D platformer tutorial and was wondering how to implement acceleration and deceleration to the players movement that uses transform.forward. I’m a beginner, sorry if this is something super simple, I just can’t wrap my head around it.

void movement()
    {
        //moveDirection = new Vector3(Input.GetAxis("Horizontal") * moveSpeed, moveDirection.y, Input.GetAxis("Vertical") * moveSpeed);
        float yStore = moveDirection.y;
        moveDirection = (transform.forward *  Input.GetAxisRaw("Vertical")) + transform.right * (Input.GetAxisRaw("Horizontal"));
        moveDirection = (moveDirection.normalized * moveSpeed);
        moveDirection.y = yStore;     
      
    }

Im not exactly sure what you want, but im assuming you want the movement of the player to be smoother. try this.

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


public class Test : MonoBehaviour
{

    private Vector3 moveDirection;
    public float moveSpeed = 5;
    public float time = 1;

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        movement();
    }

    void movement()
    {
        //moveDirection = new Vector3(Input.GetAxis("Horizontal") * moveSpeed, moveDirection.y, Input.GetAxis("Vertical") * moveSpeed);

        moveDirection += (transform.forward * Input.GetAxisRaw("Vertical")) + transform.right * (Input.GetAxisRaw("Horizontal"));
        moveDirection = (moveDirection.normalized * moveSpeed);

        transform.position = Vector3.Lerp(transform.position, moveDirection, time);
        
    }
}