Hi israel yes in certain moods I get big concentration problems.
Sometimes it just can't be helped but sometimes strategies to reduce anxiety and/or lift depression can improve it.
Things like: cut out caffeine. It may seem like it helps you concentrate but actually it just makes you more edgy and can make you anxious which screws up your concentration.
Alcohol may seem like it calms you down but actually it screws up your concentration too.
Going for a run or walk outside can help with concentration. Exercise is great for the brain, I find. Yoga exercises can also help too.
Gelert will have a lot of advice on this but I believe taking a break every hour from your work helps with concentration?
If you are doing a very boring task expect your mind to wander, in that case you may need to make up some strategies to make it more interesting for yourself.
There are some interesting strategies for how to switch to a calm and focussed state of mind in this book
http://www.amazon.com/Write-Overcome-Wr ... 1593375034
I have the book so if you want me to type some of the ideas out for you here let me know.