If (Input.GetKeyDown(KeyCode.Space) == true) isnt working

im new to c# and i need some help im watching this video

my problem is that if (Input.GetKeyDown(KeyCode.Space) == true) doesnt seem to be detecting that im clicking space

pls help

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

public class Slimescript : MonoBehaviour
{
    public Rigidbody2D myrigidbody;
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space) == true)
        {
            myrigidbody.velocity = Vector2.up * 10;
        }
    }
}

Did you assign your rigidbody from inspector, also you don’t need to add true.

public class SlimeScript : MonoBehaviour
{
    public Rigidbody2D myRigidbody;
    public float jumpForce = 10.0f;

    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Space))
        {
            myRigidbody.velocity = Vector2.up * jumpForce;
        }
    }
}

For editability I would do something like this