Is there any way to prevent them? Where to go for help?
A panic attack is usually feelings of acute anxiety, catastrophizing (making things worse than they are), helpless terror, thoughts of/feeling like they’re dying, fear, difficulty breathing, heightened physiological arousal (like for "fight or flight"), shortness of breath/dizziness, and a fear of losing control.
It can be treated with medication and therapy. Many people who experience panic attacks develop agoraphobia (fear of public spaces/crowds) because they’re afraid of losing control and what people will think of them afterward, so they avoid places with people.
There’s the possibility of it being partly learned – the one having panic attacks starts to associate the heightened physiological arousal with danger/fear, and so gets more upset when they feel themselves starting to stress. By becoming aware of these situations, and consciously thinking and learning that stress doesn’t always mean danger, they can control or learn to prevent the attacks.
So if you’re worried you might develop panic disorder for some reason, you could try consciously reminding yourself that the situation’s not dangerous, nothing to get upset about, that type of thing (as long as it isn’t a dangerous situation, that is).
See a therapist. Hopefully a general practicioner will redirect you to someone who can help and prescribe anti-anxiety drugs.
You can also experience similar symptoms from extreme caffeine overdoses (like drinking coffee for 3 days straight, pulling all-nighters, for finals; not just a couple of cups a day).