From your inputs it more or less presents as panic anxiety you have also identified certain thoughts that precede it ... I would suggest you seek a professional help they will help you better manage it .... As an immediate aid I would suggest distract yourself from focusing on the thoughts like engaging in a conversation something very different and of your interest or external focused meditation as in pay attention to the noise outside like the wind, fan, people talking etc you will notice It come down
Next Steps
seek help as I told it would be easier for you to manage with a professional support