Anxiety

I am 31 years old, and was told by my doctor that I suffered from a bad anxiety attack. What causes this? How do I prevent it? Is this usual at my age? I have never suffered from anything except your once in a blue moon headache or period pain (monthly).