There're approved exercises to train your operating memory set like N-Back[1] and others, and bunch of free apps, I liked the least boring of them[2].
But, all that does at least minimum sense if you can change your working routine. These apps can be thrown to trash if you are a fullstack developer with infinite backlog of projects. And I can't maintain hanging myself on these training apps because it makes me feel like a lab rat.
Finally, I think the root of all that attention problems is boredom, anxiety and other social crap which never going to have been cured by any science. I wonder what results would be if somebody would try to find correlation on per country working time hours and playing online games. I wage that people who're supposed to focus on some boring work are either go find some freelance payload or kill some time playing games.
[1] https://en.wikipedia.org/wiki/N-back [2] https://play.google.com/store/apps/details?id=org.owlie.brai...