func show_hit() -> void:
sprite.modulate = Color.RED
await get_tree().create_timer(0.2).timeout
sprite.modulate = Color.WHITE
await suspends just this function; the rest of the game keeps running. Godot 3's yield(get_tree().create_timer(0.2), "timeout") is this in Godot 4.
Waiting for the next frame:
await get_tree().process_frame
Or for a signal, like an animation finishing:
await animation_player.animation_finished
Mind that if the node is freed while it's waiting, the line after await still runs. Check is_instance_valid(sprite) after long waits.