For most people, it simply isn't practical to get gym equipment for their home. The equipment is expensive, and you probably don't have anywhere to put it, and it's certainly impractical to buy and store the wide variety of machines that are necessary for a properly balanced workout.
For this reason, most people choose to join a gym. For either a per-visit fee or a monthly subscription fee, you get to share the equipment with other people, paying a fraction of the price of what it's worth. You also get to exercise in a specially-designed, luxurious air conditioned environment, with qualified trainers on hand to help you get the most out of the equipment and make sure you don't hurt yourself.
However, gyms also have a bit of a reputation for being scammers: the big chains are very sales-driven, trying to sign people up for far more expensive monthly memberships than they need, and relying on people's guilt about not going to the gym to stop them from cancelling the expensive commitment.
For this reason, you really need to know what you're getting into before you join a gym. Avoid offers that seem too good to be true, and always pay the per-visit fee to go in and try out a gym first before you commit to anything. If there is no way to pay per visit, you're dealing with shady types and should probably just go to another gym.
Even legitimate gyms will generally often cheaper and more expensive levels of membership, however, so it is also important to know what you can expect. Generally, the higher membership levels offer more one-to-one training from qualified gym instructors. However, it is worth considering whether you will really use this and whether it's worth paying for, as when it comes down to it, there is little a gym trainer could tell you one-to-one that you couldn't just as easily learn from books or the Internet.