You need to check if you’re on the ground before jumping.
How to do that can vary.
For example you can do a raycast downward to test if there is a ground surface right under the player. Or if you’re using a CharacterController there is an ‘isGrounded’ flag that is set true if the last call to ‘Move’ pushed it into a surface beneath itself. Or with a Rigidbody you can listen to collision events and use some logic to decide if you’re on the ground (checking direction and if the struck collider is ground). Or any number of different methods that you would select based on your desired gameplay feel.