Free weights and machines are both good to use while working out.
As is the case with many "this or that" concerns pertaining to fitness, the answer ultimately depends on your current level of fitness and your desired end result.
In general, weight machines are an excellent tool for novices since they demonstrate correct technique and limit the danger of injury.
On the other hand, working out with free weights enables you to train more muscles and improves your functional fitness.
https://www.youtube.com/watch?v=JwHPjkzJIEc