Check out example codes for "rigidbody velocity c# unity". It will help you in understanding the concepts better.

Code Example 1

Vector3 velocity = new Vector3(10f/*x*/, 10f/*y*/, 10f/*z*/);
GetComponent<Rigidbody>().velocity = velocity;

Code Example 2

//for rigidbody2D
GetComponent<Rigidbody2D>().velocity =new Vector2(40,0);

Learn ReactJs, React Native from akashmittal.com