And if you have the dedication, you don't need to go to a gym at all, if you don't want to. One of the fittest people I have seen is a guy who was borderline homeless in Australia, who would work out along the esplanade in the city, doing push-ups and chin-ups where he could, dips on walls and squats - and lifting rocks. Seriously - random rocks on the beach.
There's no need to spend money on exercise and weightlifting. You can work every muscle in your body at home, even with a towel. If you can't afford a pool, you can swim in the sea or a lake. Plus, it's open 24 hours a day.
The benefit of going to the gym is that seeing other people there will motivate you. By socializing and building connections, you can maximize your time there.
With determination and discipline, anything is possible. The rest is just laziness.
RE: A Life of Blue Pills