How to add Countermovement?

Hi,
In the moment I am making a very simple 3D platformer with a Rigidbody 3D. And I want to add Countermovement to get a much more snappy movement. How can I do that?

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

public class Player3DMovement : MonoBehaviour

{

   private Rigidbody rb;

   public float speed;

   public float maxSpeed;

   public float counterMovement;

   private float applySpeed;

   Vector3 move;

   // Start is called before the first frame update

   void Start()

   {

       rb = GetComponent<Rigidbody>();

   }

   // Update is called once per frame

   void Update()

   {

       float x = Input.GetAxis("Horizontal");

       float z = Input.GetAxis("Vertical");

  

       Vector3 move = transform.right * x + transform.forward * z;

       if(rb.velocity.magnitude > maxSpeed)

       {

           rb.velocity = Vector3.ClampMagnitude(rb.velocity, maxSpeed);

       }

       else

       {

          rb.AddForce(move * speed);

       }

   }

  

}

There are a couple ways you could do this

First off, you could just have 0 velocity on each axis when not pressing certain keys, this will get you incredibly snappy movement

if (Input.GetButtonUp("Horizontal")
{
      rb.velocity = new Vector3(0, rb.velocity.y, rb.velocity.z);
}
if (Input.GetButtonUp("Vertical")
{
      rb.velocity = new Vector3(rb.velocity.x, rb.velocity.y, 0);
}

Or, you could do some (somewhat) simple trig math and calculate the direction the player is facing with cosine and sine Introduction to Game Development (E22: trigonometry) - YouTube
(this tutorial will help with that, but will not have the scripts you are looking for.)
and then just add force in the opposite direction the player is travelling in.

Possibly the simplest method (yes even simpler than the first one)
Would be to apply a physics material to the ground that has a high amount of friction

I hope this helps you, feel free to ask any questions if you are confused and want more help!