No quick fixes (real life, so sad!) but it can get better with counseling according to what I've read. That could look like coaching, help setting up organizational skills and supports, even mindfulness practice. A lot of that comes from you figuring out how your unique brain works. If you think back to times when you spaced out, were there triggers (distractions, not enough sleep, stress?) or patterns that you notice? Are there things that help you stay focused (like working for 10 minutes, then getting up to stretch or having something to fidget with or starting by making a graphic organizer of the material you're working on?).
For your reference, I'm on the Autism Spectrum, not ADHD, but the principal is the same. Human brains are as diverse as human bodies, and the neurotypical "one size fits all" approach doesn't make any more sense in education than only making one size of shoe.