My player jump script only jumps when VertVelocity is equal to 0.

When I enter play mode, VertVelocity is subtracted by gravity every second, as expected. The problem is that I can only jump when VertVelocity is equal to 0. (Which was not expected.) When I move VertVelocity is equal to 0, then with some random decimal value after that. I can only jump when the VertVelocity is 0.random_decimal. How do I change this so I can jump whenever player.isGrounded = true?

 using System.Collections;
 using UnityEngine;
 
 public class PlayerJump : MonoBehaviour {
 
     public CharacterController player; 
 
     public float VerticalVelocity; 
     public float Gravity = 14.0f; 
     public float JumpForce = 10.0f; 
 
     void Start () 
     {
         player = GetComponent<CharacterController> (); 
     }
 
     void Update () {
         if (player.isGrounded) {
             VerticalVelocity = -Gravity * Time.deltaTime; 
             if (Input.GetButtonDown ("Jump")) {
                 VerticalVelocity = JumpForce; 
             }
         } else {
             VerticalVelocity -= Gravity * Time.deltaTime;
         }
 
         Vector3 moveVector = new Vector3 (0, VerticalVelocity, 0); 
         player.Move (moveVector * Time.deltaTime); 
     }
 }

I am not sure why you are doing the things you are doing. And I would suggest staying away form the character controller because it is outdated I think. So I am going to give you my example of how I would achieve a jump for a character in 3D project.

//Code for 3D Solution

public Rigidbody playerRB; 
public float JumpForce = 10.0f; 
private bool isGrounded = true; // assuming its already grounded
private bool isJumping = false; // character starts in an idle state

void Update()
{
	if( isGrounded && Input.GetKeyDown(Keycode.Space))
  {
		isJumping = true;
  }
}

void FixedUpdate()
{
	if(isJumping = true)
  {
    	playerRB.AddForce(Vector3.Up * JumpForce ,ForceMode.Impulse);
      isJumping = false;
  }
}

void OnCollisionEnter()
{
	isGrounded = true;
}

void OnCollisionStay()
{
	isGrounded = true;
}