How can I jump with CharacterController? ;-;

How do I write a script to jump by pressing the space bar and using the Character Controller?

First get the rigidbody like this:
private Rigidbody playerRb;
void Start()
{
playerRb = GetComponentRigidbody();
}
Then add force to make the player jump:
if (Input.GetKeyDown(KeyCode.Space) && isOnGround)
{
playerRb.AddForce(Vector3.up * jumpForce, ForceMode.Impulse);
isOnGround = false;
}
Jumpforce is a float i made you can make it like 350 or so
isOnGround is a bool to make sure the player is on the ground while jumping. You can set it true again with:
private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.CompareTag(“Ground”))
{
isOnGround = true;
}
Tag your ground “Ground”. Hope this works!