When a cube is moving how can I make it so that it can't jump when it is in the air?

I have a cube that is on the scene and when you press one of the arrow keys it moves up and in the direction of the arrow key. When you click while the cube is already in the air it jumps again before it gets back to the ground. How do I make it so that the cube can't jump again until it is back on the ground? This is my code so far:

Make the Boolean jumping false if the player is in contact/colliding with the ground. If not make it true. Then add and check it with the jump input condition so true will not let jump and false will let jump.

For detecting ground use some code like below. Tag the ground as you want. Both player and ground will need collider component and at least one of them will need Rigidbody component attached.