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.
I've replaced all my aimless Reddit scrolling with Lemmy. I'm not so purist I refuse to go there though - there's still a lot of good info organized there, and it's still decent for searches.
I've replaced Twitter too. Ironically Facebook is the one that sticks around, despite being probably the most user-hostile. That one's built around people I know IRL and it's not so easy to drop in a replacement. Even though it's not very good for that or any purpose.