Any sustained cognitive task requiring prolonged sustained attention/concentration can act as a stressor especially when you are not getting desired outcome or best expected performance. I think first issue to address is your concentration difficulties which could be an independent problem or part of an anxiety or depressive illness. You will need a detailed evaluation with a Psychiatrist to ascertain the cause. There are several solutions to the issue including mental exercises, restructuring your tasks, psychotherapy and medications if required.
Next Steps
Detailed evaluation with a Psychiatrist
Health Tips
You could consider getting Hemogram,
Thyroid Function tests,
vitamin B12 levels and Vitamin D3 levels done to rule out physical causes.