Honestly it sounds like you had a stress triggered anxiety event for the first time. It happens! In fact, your lucky that it hasn't happened more often. In short, I would recommend a two fold approach: 1) manage the overall stress level in your life to avoid going past a certain threshold. 2) Develop techniques for coping with the anxiety for when you do wind up crossing the threshold and spinning out.
I personally find breathing techniques to be the most useful fix when I need to sleep / and slipping into an uncomfortable state. Once I discovered the correlation between my subjective stress level, heart rate and heart rate variability I got super interested in biofeedback breathing applications and I'm even developing my own
https://play.google.com/apps/testing/com.martianwearables.hrv_flowt. There are other good ones though, I encourage you to explore HRV biofeedback to help you manage symptoms. Let me know if you have any questions.
I think it was smart of you to post here after your first anxiety experience, that is very pro active and I think that by taking action now you can best manage your stress levels and thus your anxiety symptoms. Cheers