1) Never tell them to "just stop worrying" or to "just stop thinking about it" if they are in the midst of an anxiety attack. It does nothing. If you could just stop worrying about whatever it is, we totally would.
2) Remind them to breathe. Different people have different numbers, but basically concentrating on how long to breathe in, how long to hold it, and how long to exhale helps a lot. I was originally told to do 4 seconds in, 6 seconds hold, 8 seconds exhale. Over time I've changed it to 5 seconds in, 2 seconds hold, 5 seconds out, 2 seconds wait. Your friend can find the numbers right for him and it will help a lot.
3) Often times you just kind of have to ride out the attack and wait for it to end. Personally I always find it helpful to be by myself with a nice set of headphones and music of my choice. My college roommate said it always helped her get through attacks by just doing stream-of-consciousness writing. Maybe try different things with your friend to find what helps him calm down - maybe it's reading a good book, listening to music, writing, gardening, gaming, whatever.
Anxiety attacks are no fun. But if you can help your friend get through them more easily, he will definitely be grateful to you.