First off I have no clothes you’d ever wear to a gym. I wear jeans and a t shirt pretty much daily (think Hank Hill). Second, I don’t get what you do there. I hated gym time in school (workout gym, not like throwing balls and running around gym, thats fun) and I don’t get what you do. Run on a treadmill and lift some weights? I feel like I could do all of that at home. Gym memberships are insanely expensive. Are home workouts actually effective? Does one even enjoy gym time?
You’re absolutely correct that you can do all that at home. Will you? I find that going to a place puts me in the right state of mind to do the thing. They do have a lot of equipment available, but you can mostly replace it at low cost by running outdoors or buying a few dumbells.
Likewise for the costume - when I started going, I was very worried about making sure I had gym shorts and running shoes and a sweat wicking shirt and a gym bag. I got that stuff and it did help, just mentally put me into the place for it. But after a while I realized I could just go in casual clothes (though my gym bans jeans) and it’s fine. Up to you what’s more motivating - workout clothes or reducing friction by wearing what you’ve got.
As for what to do there - again, it’s your call. Generally they have several flavors of weight machines, cardio machines, free weights, usually some kind of aerobics space.
You set your own goals and routines. In contrast with something like school, no one’s going to force you to exercise. You have to want to - whether that’s for the fun of it or to achieve some health result.
Gyms also tend to offer classes, or personal trainers you can hire if you want more structure.