Is it "better" to buy some equipment and work out at home, or pay a fee to go to the gym regularly?
Both. We have a great smallish gym here which is very concerned with the health of it's members. It was closed during most of the pandemic and I did a lot of workouts at home (which I still do). Later they reopened and a couple of months ago required members to show proof of vaccination. Lately a mask mandates were re-instituted. They also installed some great air filters with UV purifiers. The gym is never full and several programs are offered including a Silver Sneakers one for the more sedentary. [lopezfit.org]
Personally I wouldn't join an indoor gym at this time, but I was a member of my local gym off and on over the years. This last time, I canceled, just a few years ago, I was paying $50 per month, but by saving that $50 each month, I actually felt I got more of a workout using my outdoor pool (even though it's cold most of the year, I wear a wet suit) and my bicycle (I have a bike path right outside my door) and evening walks (I live right along a beautiful walking trail.)
I can also dance and do some floor exercises in my home, and have various things I can use as weights, if I choose. I use swim paddles in my pool to get a bit more resistance than regular swimming. Not sure if all that helps, but I enjoy it. (Besides, I can listen to my own music instead of the rap they had playing at they gym.) I do miss the weights though.
So, I checked the box for "depends on how much equipment you have at home."