I have had those pains too @utopia@Faith-and-Hope. Panic attacks that can come out of nowhere sometimes. Haven't had them for a little while now thankfully.
I reckon your subconscious mind can bring them on at times. I have had them in the middle of the night waking up from a dream, during the day and once when I was out. That was scary. I felt so faint and had trouble breathing as well. The chest pain feels like a heart attack not that I have ever had one.
I find that concentrating on breathing and mindfully telling myself that this will pass helps. Focussing on something whether it be an object I can see or the sounds I hear or anything that will distract me is good too.