How can I add Gravity to my custom Player Script? c#

As shown above, I want to add gravity to my player script. I have searched all over the internet, the wiki, and script reference and still couldn’t find the answer I was looking for. I just basically want to add gravity to my player. Here is the script.
enter code hereusing UnityEngine;
using System.Collections;

public class PlayerMovement : MonoBehaviour {
	public float playerSpeed = 3f;
	public float jumpSpeed= 7f;
	public float sprintSpeed= 5f;
	public float gravity = 20f;
	// Use this for initialization
	void Start () {
 
	}
	
	// Update is called once per frame
	void Update () {

			if(Input.GetKey(KeyCode.W)){
				transform.Translate(Vector3.forward * playerSpeed* Time.deltaTime);
					animation.Play("Walk");
		}
			if(Input.GetKey(KeyCode.S)){
				transform.Translate(Vector3.back * playerSpeed* Time.deltaTime);
					animation.Play("Backpedal");
		}
			if(Input.GetKey(KeyCode.D)){
				transform.Translate(Vector3.right * playerSpeed* Time.deltaTime);
					animation.Play("StrafeLeft");
		}
			if(Input.GetKey(KeyCode.A)){
				transform.Translate(Vector3.left * playerSpeed* Time.deltaTime);
					animation.Play("StrafeRight");
		}
			if(Input.GetKey(KeyCode.Space)){
				transform.Translate(Vector3.up * jumpSpeed* Time.deltaTime);
					animation.Play("Jump");
		}
			if(Input.GetKey(KeyCode.LeftShift)){
				playerSpeed = sprintSpeed;
					animation.Play("Jump");
		}
		}
		
	}

simply add a rigidbody in the editor to your character, constraint it on all axes except position.Y and you’re all set