Before you do anything, start with a visit to your doctor - share your thoughts with them on what you want to do / accomplish. A good doctor will help you develop a plan that is sustainable and will last long-term vs. the quick fix.
If you think you want to join a gym, try it before you buy it. I have watched many people come to my gym and try it, only to never come back because the classes they thought were going to be easy are too hard because they have let themselves get so far out of shape. As others have said, find something that you can start out slow and grow with vs. doing something difficult and quitting because you cannot finish a workout or set.
Stay committed - you have to really want it. For years, I used to say I was going to do something and never did a thing. Then, four years ago, something changed and I decided I didn't want to be fat anymore. I lost 90 pounds and have kept it off. What does that mean, I go to the gym four times a week and if I don't go to the gym, I use my tread climber at home and workout on it. During the pandemic when my gym was closed, I used my tread climber and kept working out. It was a lifesaver when the gym opened back up because I was in shape. One other thing, give your body a rest every so often. I took two days off from the gym to let my body rest and recover. When I went back last week, I had the best workouts I've ever had. My body felt great, and I had a fantastic week, which has carried over to this week.
Eating is key - you can workout daily, but if you do not change your eating habits, good luck. I gave up a lot of stuff I loved to eat, but in order for me to lose weight, I had to eat clean. I thought eating clean would be hard, but it really isn't. The other thing with eating, read food labels and understand serving/portion size. I never paid attention to portion size until I started losing weight and realized I overate all the time.