I've experienced something similar and the only thing you can do is harm reduction and waiting it out
Make sure you're staying cool because it's easy for your body to overheat in this state. Drink some water and lay down or sit, maybe even stim a little by rocking back and forth or whatever (only if it helps, don't force it.)
Know that your body is in a temporary state of panic and you'll return to stability soon, don't fight your thoughts, let them pass through and just cry.
If it's getting really bad seek medical help tho.