How can i add a groundCheck to my script?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class playerMovement : MonoBehaviour
{

public Vector2 jumpHeight;
public Vector2 fall;
public bool isGrounded = true;

// Start is called before the first frame update
void Start()
{
    
}

// Update is called once per frame
void Update()
{

     if (Input.GetKeyDown(KeyCode.Space))
     {
        GetComponent<Rigidbody2D>().AddForce(jumpHeight, ForceMode2D.Impulse);
     }

}

}

If you want to check the ground before jumping, you can use Raycasting Unity - Scripting API: Physics.Raycast