How do i make my grounded variable change as I hit the platform and as I jump?

The Trigger entry and exits arent working and the boolean stays as false

using System.Collections;
using UnityEngine;

public class CarMovement : MonoBehaviour {
public float speed;
public bool grounded = false;
public float reverse;

void Update () {

	if (Input.GetKey (KeyCode.RightArrow)) {
		if (grounded = true) {

			float moveHorizontal = Input.GetAxis ("Horizontal");
			Vector2 movement = new Vector2 (moveHorizontal, 0.0f);
			GetComponent<Rigidbody2D> ().AddForce (movement * speed);

		} 
		else if (grounded = false)
		{
			
		}
	}
	if (Input.GetKey (KeyCode.LeftArrow)) {
		if (grounded = true) {

			float moveHorizontal = Input.GetAxis ("Horizontal");
			Vector2 movement = new Vector2 (moveHorizontal, 0.0f);
			GetComponent<Rigidbody2D> ().AddForce (movement * reverse);

		}
	}
}

void OnTriggerEntry2D () {
	grounded = true;
	}

void OnTriggerExit2D () {
	grounded = false;
}

}

If you want to use the in Unity build Colliders the correct Function is

void OnTriggerEnter2D(Collider2D col){
     grounded = true;
}

and make sure your colliders are set to trigger.

It is OnTriggerEnter2D (not OnTriggerEnt ry 2D).

See Unity - Scripting API: MonoBehaviour.OnTriggerEnter2D(Collider2D)