Access the keyboard with:
Keyboard.current
Pressed this frame:
if (Keyboard.current.spaceKey.wasPressedThisFrame)
{
Jump();
}
Held:
if (Keyboard.current.wKey.isPressed)
{
}
Released:
if (Keyboard.current.spaceKey.wasReleasedThisFrame)
{
}
Always consider checking whether Keyboard.current is available before using it.