It is important to accept that we sometimes fail. And if we fail we need to learn and move on. Learn better ways, making it more likely we succeed next time.
But we should never include failure as an option in our plans. We should mentally aim for success. And success only. The planned actions should always lead to success in our minds.
Keep these two separated.
If we let failure be part of the plan we have an option mentally competing with success. And maybe we lower the ambition? "failure is ok - its an option in the plan"....
Again - Keep them separated. First: Never let "failure" be an option in the plan. Second: If failure - learn and move on.
Do not mix!