In a nutshell
The right moment to resign.
In detail
When the loss has become clear, a fitting moment to resign is called nageba.
In professional games, players often resign at a natural break, such as right after a do-or-die move fails. There's even an expression, “looking for a place to resign.”