Day dreaming is something different thing, its more related to fantasy which is voluntary in nature. It could includes thinking about our goals, interests or imagining an unlikely or likely future scenario.
We can't say the exact reason without taking full history of your problems. May be you are unable to concentrate on your given task that is symptoms of Depression, Anxiety or stress. So it will be helpful to consult a Clinical Psychologist, who can better understand your problem and help you to stay in present and focus on your work..
If you are comfortable in online session then you can contact me or another Clinical Psychologist or else you can visit a Hospital/ Clinic.
Next Steps
Consult a Clinical Psychologist or a Psychiatrist.
Health Tips
try to schedule your daily activity and do according to your schedule so that can't be distracted. try be focus on present moments.