If you’re not using physics like the user above me has suggested and you’re managing the ball’s movement manually, you can multiply its current velocity by a damping factor, it represents be mass, air resistence or whatever you can think of as a damping factor in a physics body