Stop Character Drifting after using AddForce

Hi, i am creating my first own 2d Unity Project. i Made my character move with rb.Addforce, but after the character moves, and you let go of the button it takes a while before the character stands still again. it kinda drifts across and slowly loses acceleration. is there a way to minimize the time it takes for my character to stop moving, or tottally delete the drifting thing, or somehow set the acceleration to 0?.
i tried this cuz i only want to affect the x acceleration but doesnt work: rb.velocity.x = 0f;

Im totally new to unity and sorry for my not too great English.

If its 2d try using Input.GetAxisRaw to make him stop

right now my character moves with if (Input.GetKey(KeyCode.LeftArrow)) so i cant use input.GetAxisRaw. do i have to redo my script and change it to using axis instead of specifc keys. its just im making a 2 player game so then i cant use the same axis so move both of them.

Try to use a higher drag on the rigidbody. You can change it in the inspector or by script with rb.drag = 5 (for example). You may need a stronger force to move your character then.