Look into complex PTSD. I started having awful panic attacks years after being done with home schooling and a lot of it came down to my body finally feeling safe enough (good job, friends etc.) to process all the fear and isolation and emotional abuse of my teens.

You can figure out strategies to deal with the panic attacks. Sometimes something as simple as walking, deep breathing, and reminding yourself of the present help.