How can the ball be moved like billiards after wall collision?

I tried ball.velocity = Vector3.forward * speed and also * = – 1 when the collision occurred (It only works directly, but I want the movement of the ball to be similar in the photo.) How can I do it? !

enter the description of the image here