it IS very difficult to control one's thoughts when in high pain, or fatigue etc I know this personally. I also realize that it isn't the pain or fatigue that is causing the anxiety and worrisome thinking...it's my thinking that is causing the increased anxiety and fear!
To live in the here and now is very perfect living...and we being imperfect humans...well there will be a disconnect of some sort.
It does me no good to think about yesterday, or even last hour and what went "wrong" for instance...it's over, I did the best I could and that's that! And it does me no good to think about tomorrow or even next hour, as I have no idea what it brings ...whereas right now I DO know and I can focus on doing my best... even in high pain I do better if I stay in the here and now and manage it because if I begin to think beyond right now (what if it doesn't stop, what if it gets worse, how will I ...????) then I make it worse in the here and now. I surely don't wish to do that!
It didn't come easily, and I'm not perfect at it (which is why posting here at PC when in that cycle is a good thing to help break it) but I did learn how to take care of myself when in pain flares... I have mantras I use to remind myself, in fact, such as, "this is just tough right now, it won't stay this way", "I can do this" etc.

It's a learning process...but well worth the effort.