If possible, stop what you are doing and sit down or lean against something (if you are driving, pull over and park in a safe place. If you are in company, it is sometimes appropriate to excuse yourself for a moment).
Hold your breath and count to seven (don’t take a deep breath).
When you get to seven, breathe out and say the word “relax” to yourself in a calm, soothing manner. Remember to breathe through your nose.
Breathe in and out slowly in a six-second cycle. Breathe in for three seconds and out for three seconds. This will produce a breathing rate of ten breaths per minute. Say the word “relax” to yourself every time you breathe out.
At the end of each minute (after ten breaths), hold your breath again for seven seconds and then continue breathing in the six-second cycle.
Continue breathing in this way until all the symptoms of over-breathing have gone.
Check out this article for more and detailed techniques to help relieve your anxiety.