,How to make a platformer-like jumping script?

,I’m new to unity, (especially new to C#) and I want to make my character jump in a game I’m making. I don’t know how to make it so you can’t jump in midair, because I suck at variables and collision detection :stuck_out_tongue: anyone know how to do this? (Sorry for asking a newbie question)
Here is my code so far if you want it (for the player)

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

public class Movement : MonoBehaviour
{
    public Rigidbody2D rb;
    [SerializeField]
    KeyCode keyPositive;
    [SerializeField]
    KeyCode keyNegative;
    [SerializeField]
    Vector2 force;

    void FixedUpdate()
    {
        if(Input.GetKey(keyPositive)) 
        {
            rb.velocity += force;
        }
        if (Input.GetKey(keyNegative))
        {
            rb.velocity -= force;
        }
    }
}

There are of course many ways, but I suggest using an empty Gameobject attached to the bottom of the player, then checking if the object is overlapping with a specific layer (Layermask called whatIsGround)

private bool isGrounded;
        public Transform groundCheck;
        public float checkRadius;
        public LayerMask whatIsGround;
   void FixedUpdate()
    {
            isGrounded = Physics2D.OverlapCircle(groundCheck.position, checkRadius, whatIsGround);
    }

And then just get the user Input and change the velocity.

if (Input.GetKeyDown(KeyCode.Space) && isGrounded == true)
            {
            rb.velocity = Vector2.up * jumpForce;
            }