Ability to overcome distractions, ignore external influences, and conquering obstacles that inhibit them from performing tasks. what is this called?

This can be called either "focus" or "mental resilience".