When you can interpret every situation without mistake, and if the situation is correctly identified, choose an appropriate course of action.
Such knowledge takes a lifetime to accumulate.
However, safe operation can be achieved in limited circumstances (the absence of unnecessary risk), providing that the operator has sufficient knowledge and skills (know how) to execute specific tasks and use safe guards to identify and recover from error, but most important to be aware of one’s individual limits in knowledge and know how.
And even then, you can be wrong ... ... not safe enough.
Errors in Aviation Decision Making.