I only want my character to jump Only if he is touching the Ground

The title says it all, i only want my character to be able to Jump if he is Touching the ground
and i don’t know where to start i’m pretty new to Unity and C# and if you guys could help that would be great!

Here is the Runner Code

using UnityEngine;
using System.Collections;

public class Running : MonoBehaviour {


	public static float distanceTravled;
	
	public float acceleration;

	public Score score;

	private float seconds = 1;

	Animator animator;
	
	public bool dead = false;
	float deathCooldown;

	public Vector3 jumpVelocity;



	// used to get animations
	void Start () {



		animator = transform.GetComponentInChildren<Animator>();

		if (animator == null) {
						Debug.LogError ("Didn't find animator!");
				}
	}
	
	
	
	// Update is called once per frame
	void Update () {
		if (dead) {	
		
			seconds -= 1 * Time.deltaTime;
						if (seconds <= 0) {
								Application.LoadLevel ("DeathScene");

						}
				} else {
						if (Input.GetKeyDown (KeyCode.Space) || Input.GetMouseButtonDown (0)) {
								rigidbody2D.AddForce (Vector3.up * 185);

								
								//Jump animation
								animator.SetTrigger ("DoJump");
						}
				}
	}


	void FixedUpdate() {
		if (dead)
						return;
		//Run Speed
		transform.Translate (4.2f * Time.deltaTime, 0f, 0f);
	}
	//Collider to die
	void OnCollisionEnter2D(Collision2D collision) 
	{

				if (collision.collider.tag == "Obstacle") {
						animator.SetTrigger ("Death");
						dead = true;
						audio.Play();
			}
		
		if (collision.collider.tag == "ObstacleBag") {
			animator.SetTrigger("Death");
			dead = true;
			audio.Play();
		}

		if (collision.collider.tag == "ObstacleGarbage") {
			animator.SetTrigger("Death");
			dead = true;
			audio.Play();
		}
	}
}

And that is the code thanks for the help in advance!

As @screenname_taken suggested, you need a to store whether you are grounded or not. You want to check for collisions (OnCollision events such as OnCollisionEnter2D), and then inside that event check for the type of collision - is it the ceiling / floor for example. A simple way of doing this would be to RayCast up and down from the character - if the down ray collides with something you are grounded. You may need to ray cast more often than just on collision - for walking off edges etc.

No code, but I hope that helps =D