Part of it is context. Is the “stage” (i.e., the place you are going to partake in intimacy/sex) set to allow for you to feel in the mood? I always reference movie scenes for my clients. Why? Because movies have to visually create a space that conveys a certain message and helps us to feel that sex can occur there, in that space and time. It isn’t much different at home. Music, lighting, bedding (if in the bedroom) all can add to or subtract from helping you feel more comfortable and in the moment.
The other part is your brain. There is a high likelihood that it will never just shut itself off or be quiet. Instead, try guiding your brain to actively participate in what you are doing. Use your five senses to completely experience your intimacy/sex. How does it feel when your partner touches you, when you touch him? What does your skin actually experience from the sensation provided by touch? How does he taste when you kiss him, or even when you give him oral? Granted, I do not expect the answer to be pleasant so much as are you mindfully present enough to be aware of what is happening. Lean into the experience and try to experience only that which is going on. If you find your mind drifting to off-subject matters, try guiding it back. What does he look like? What does his O-face look like? What noises do you both make, verbally or otherwise?
Anxiety is very real and can invade so many aspects of our lives. If this continues to be a struggle for you or is already a struggle for you in sex and/or other areas of your life, consider find a therapist in your area that can assist. As I stated, there are a lot of great coping techniques that can be applied to sex similarly to how we use them in daily life. Good luck.