Sometimes you want to help. You hug the person, you switch the lights off, you close the door, etc. And it worsen the situation.
It's to avoid such cases I'm telling you this. It will basically make you feel guilty, and make the person suffering (I think I can use that word) the panic attack feel terribly afraid.
Ask. If you are told to go away, you can always ask a second time. But never go far. Always be there and listen.
I sometimes run away. I sometimes tell my gf to let me alone. And call her for help a few seconds later. It isn't rational, but a panic attack isn't lead by reason.
Don't abandon the person.