I need help

So today I took my daughter to her first gymnastics class and let me tell you this girl would NOT listen and was running everywhere. Literally out of control. I wanted to leave the class early. She would scream when I would try to have her sit and listen. It was not an enjoyable time for the both of us.

How do you guys deal with this? Or any advice please. I feel like I’m failing as a parent. She’s never like this at home, only seems to be when we go out. But even at the grocery store she just sits in the cart and doesn’t try to get out.