Good Jumping and Moving a ball

I making a 2D game, just i have ball and blocks, so i have troubles with jumping and moving. Now i have jumping and moving like this:

void FixedUpdate()
{
	if (Input.GetKey("up") && Physics.Raycast(transform.position, -Vector3.up, 1))
	{
		rigidbody.velocity += 5 * Vector3.up;
	}
	
	if (Input.GetKey ("right")){
		rigidbody.velocity += 1 * Vector3.right;
	}
	
	if (Input.GetKey ("left")){
		rigidbody.velocity += 1 * Vector3.left;
	} 
}

But this is really bad (when i collide with wall, is staying (when hold right or left)) etc… So what is alternative to make good and smooth moving & jumping? Thanx

Use AddForce instead of setting the velocity.