The debate between free weights or machines is old.
Ask people in the gym and you will get various answers.
Which is better?
It depends on their application and your goals. Machines are good at isolating motion and offer safety for the inexperienced exerciser. These two positives are also their point of contention.
The body does not move in isolated movement and natural motions actually take place in diagonals and spirals. The safety they offer is in limited motion, which can lead to loss of balance and stability.
Free weights offer increase range of motion and demand more stability. They can also be dangerous and it is easier to compensate with poor motion.
The danger and compensation usually happens when an inexperienced lifter uses too much weight or does not perform good form.
This contrast of implements can be illustrated in the example of a chest exercise. In a machine press, the path of the weight is directed by the machine and the arm position is pretty much set.
This makes it hard to cheat, but is typically an unnatural movement unless your body is the exact one the machine was designed for and you have no injuries and proper movement.
The machine also stabilizes your core and shoulders for you so you do not strain the rest of the body.
The free weight bench press will let you press the bar or dumbbells in a natural motion and you can grip the bar so that it suits your body type.
You will need to stabilize the core more and the shoulder blades more, even though the bench will do some of that for you.
The danger is if you cheat or drop a weight on yourself. But if you use body weight as in the push-up you will have to stabilize your whole body, will use weight you can handle thus making it self-limiting.
So, what is the best? Body weight is best, at least at first.
Learn how to move correctly and perform the movements with body weight. Then free weights will allow you to overload your body when you know how to perform exercises well.
Machines work well when they are the least inhibiting type such as cable or pulley machine — this includes bands. Isolation is best used for rehabilitation when safety and specificity of increasing the strength of a muscle is needed.
The other thing to consider is access. If your gym only has machines, it is better than nothing but perform body weight exercises to counteract the limits of machines.