When you say it's been a long time, how long?
I have two thoughts: it could be ADHD or depression. When I'm in a depressive episode, it's like my mind is foggy and I can't focus or remember anything. So if it comes and goes, it could be depression.
If it's a constant thing that you've had since you were a kid, it could be ADHD.
Either way, you'll need to see a doctor to get a diagnosis and treatment plan. There are medications that can help. With my meds, I can hold down a full time job.