You cannot “wait” for an Input.
the builtin functions like _ready or _process need to run without endless loops.
Depending on your need, you can try this:
func _process(delta : float) -> void:
if not Input.is_action_pressed("confirm"):
# do something if the key is pressed
pass
else:
# do something else if key is not pressed
pass
or declare a variable already_pressed and do it like this:
var already_pressed : bool = false
func _process(delta : float) -> void:
if Input.is_action_just_pressed("confirm"):
already_pressed = true
if already_pressed:
# do something if the key was pressed
pass
else:
# do something else, if key was not pressed yet
pass