Why this happens?

I copied a moving system from YouTube to improve my chrecter movement. But the chrecter always moves a little and then stops and I dont know why. I think it might be connected to the X velocity in the rigidbody because the charecter always stops when the velocity drops to 0.
This is the script:

 Speed = _moveInput.x * MaxSpeed;

        if (Input.GetKey(KYBRight))
        {
            IsFacingRight = true;
            IsMoving = true;
            float SpeedDif = Speed - rigidbody2.velocity.x;
            float movement = SpeedDif * accelaration;
            rigidbody2.AddForce(movement * Vector2.right);
            print(movement);

        }

And here's a video of the problem:
https://i.gyazo.com/9fc0703827eaa3647a92fe966f5afd2d.mp4

Is the ground made from multiple box colliders? What is the shape of collider of player character?

Without knowing more my best guess is that corner of box collider is getting caught on the seam between multiple ground colliders.
8923598--1222619--upload_2023-4-3_13-14-7.png

You can mitigate it by making the corners of box colliders slightly round using edgeRadius property https://docs.unity3d.com/ScriptReference/BoxCollider2D-edgeRadius.html . It will change box with sharp corners, into a box with rounded corners. Just like in real life stuff with round corners is more likely to slide smoothly. Link to scripting API but it can also be set in the editor. As you increase the radius you might need to decrease the box collider size to maintain the overall dimensions.

8923598--1222622--upload_2023-4-3_13-14-48.png