Stress isn't always a bad thing. Eustress, or stress that impacts you positively,
can help you achieve a state of flow. This happens when you are facing a task that you deem challenging, but its difficulty level is enough for you to still be successful in completing it. However, stress that impacts you negatively, which is also known as distress, can make you
lose focus easily. When the task that you need to do is perceived as insurmountable, the stress becomes overwhelming and leads to task disengagement. When this happens, you will lose focus on the task and choose to do something else to alleviate yourself from the distress you experience.
Anxiety impacts your focus in a similar manner, and thus it is important to regulate both your stress and anxiety if you want to never lose focus.