Two days ago I received the opportunity to acquire some unused weightlifting equipment from an uncle for free: a weight bench, a curl bar, and some free weights. I just had to buy an Olympic barbell to get started.
I always found gyms to be overly expensive and inconvenient. Most people join one to improve their health, so it's important to remove the barriers to entry. You don't need complex machines or long cardio workouts to get this done: a barbell and some free weights in your garage do wonders.
As long as you do not lift too heavy, you can buy cheap equipment for less than $100 bucks. Those are perfect for a casual physical maintenance routine.
Security is the only thing you must be extra careful with. The first step toward a safe workout environment is to learn proper form and proper breathing, so get a mirror or record yourself to adjust the position of your body: squats, deadlifts, overhead press, barbell row, and bench press are the only exercises you need to get started with an efficient workout program.
When your muscles get sore there is a non-negligible probability you will drop the weight, so you need a safety net to prevent any harm. A squat rack is a great investment. I use two adjustable trestles in parallel to the same effect.
I started learning weightlifting two years ago back in Stockholm. Most residential apartments have a shared gym (including a sauna) so I took the opportunity to learn. The results were much more impactful than my traditional bodyweight exercise. I stopped at about 132lb (60kg) in squat weight, which was 10 times what I was capable of when I began.
Having your own gym is a great investment in your health: $50 monthly subscription vs $500 bucks top to gather the initial pieces of equipment (bench + trestles + free weights + Olympic barbell). It is also the surest way you do not miss a single session since there is literally no excuse to skip your visit to the gym: no waiting time, no queue, no crowd of flexing gym rats, no Instagrammers, no commuting... just you and the iron meditation, so make your own gym!