Problem with object collisions

I’m having a fairly annoying problem with my character script. Whenever the capsule character hits a wall, it spazzes out a little bit, and sometimes it will start rotating and stuff.

Here’s the script:

void Start () {
	
		transform.position = new Vector3(0,3,3);
		Physics.gravity = new Vector3(0,-5,0);
		
	}
		void OnCollisionEnter (Collision collision){
			grounded = true;
	}
	
		void OnCollisionExit (Collision collision){
			grounded = false;	
	}
	
	// Update is called once per frame
	void Update () {
	
		if(Input.GetKey ("a")){
			transform.Rotate (0, negativeRotationSpeed * Time.deltaTime, 0);
			
		}	
		if(Input.GetKey ("d")){
			transform.Rotate (0, rotationSpeed * Time.deltaTime, 0);
			
		}
		if(Input.GetKey ("w")){
			transform.Translate (0, 0, speed * Time.deltaTime);
		
		}
		if(Input.GetKey ("s")){
			transform.Translate (0,0, negSpeed * Time.deltaTime);
		}	
		if(Input.GetButtonDown ("Jump")&& grounded == true){
			
			rigidbody.AddForce (Vector3.up * jump);
			
		}
	}
}

You should not be moving, rotating, etc. your object with transform.translate since you have a rigidbody attached.

You should use the rigidbody for movement, just as you addForce when you jump, you should AddTorque when you rotate. Your other translates should turn into AddForce in either your x, y, or z axis (looks like you want to use the z).