Once a 'try' is declared 'failed' the critical worry is to surrender to the gravity of exit, departure, disengagement. To prevent this, if necessary, try again, repeating the failed attempt. If the human trier is not so pressured then he or she need to ask themselves: question 1 (q1): "Is the goal I tried to achieve, and just failed, still valid?"
This may be an easy question to answer, or hard one. If a doctor tries to save the life of a patient then it is quite clear to her whether her patient is still breathing. But if a doctor tries to prevent a patient from contracting a disease, it is not readily clear if the patient is already sick. Alas, the validity of this 'direct goal' per se is only part of the question. The validity of a goal depends on the validity of the higher goal it serves. If that higher goal is no longer valid for any reason, then the direct goal, however attractive is valid no more, and to TryAgain to achieve it, is pointless. In fact a goal is valid if every goal about it up to the root goal for that person are all valid.
If the answer to q1 is negative, then the human trier may face a critical junction: an emotional collapse. To prevent it, it may make sense to keep trying what was tried before, which is now pointless. The reason is that it keeps the juices rolling, the sense of living, the practice of burning energy -- which will soon be redirected to better causes. We often see one administering CPR to a person that is clearly beyond resuscitation, escaping an emotional crash. But very quickly it is important to turn up to the higher goal that was served by the direct goal. If the physician lost a patient in a mass accident, he may look to serve the goal of helping others in the same accidents. There is always a higher goal to serve, except for the root goal, which in turn will never turn invalid.
If the answer to q1 is affirmative, then the trier should invoke the TryAgain Template.
This procedure applies equally to AI entities.
Summary: when a try is declared a failure, the validity of the goal that was addressed, should be evaluated. If it is no longer valid, then the next try should address the higher goal. If this direct goal is still valid, then the trier should activate the TryAgain Action Template.