Losing focus could be e.g., (1) lacking the attention span (ability, fatigue, disinterest), (2) lacking the working memory to hold the problem; (3) distraction (by more important or interesting things); (4) focusing too hard on the wrong things (and getting no where); etc.
Solutions differ, but like talk therapy, most any approach will have some positive effect just via escape from oblivious continuance or self-defeating (mental) behaviors, if not development of insight (i.e., self-observation).
To me the key is that thoughts are motivated (interesting) and amplified (concerning or exciting); the key is to recognize that you are the source of that energy, and learn to notice and decide whether this energy is helpful in the situation. Usually that means letting it go, but sometimes you need to raise it (e.g., to address an instance of ongoing injustice). Then focus is a function of having the energy needed for a given situation - no more or less.