How do I check if my player is grounded with physics?

I try to make player jump with Rigidbody
but it doesn’t work.

checkCollider = Physics.OverlapSphere(groundCheck.position, groundRadius, groundLayer) // a collider with its parameters
if(checkCollider.Lenght > 0) {
isGrounded = true;
} else { 
IsGrounded = false:
}
if(Input.GetKey (KeyCode.Space) && isGrounded) {
GetComponent<Rigidbody>().velocity = (GetComponent<Rigidbody>().velocity.x, jumpSpeed, GetComponent<Rigidbody>().velocity.z);
// I have the jumpSpeed variable

float DisstanceToTheGround = GetComponent().bounds.extents.y;

        bool IsGrounded = Physics.Raycast(transform.position, Vector3.down, DisstanceToTheGround + 0.1f);