Where specificity matters
If you want to improve your barbell press, you need to master it as a separate skill. Working out muscles on a machine can be part of your routine, but it doesn't fully replace practicing the movement with a barbell.
In the meta-analysis of direct comparisons no clear overall advantage for one format in muscle growth was found; strength gains varied significantly depending on the movement tested. This doesn't mean any two exercises are equivalent.
How do I decide for a beginner?
Check where it's easier to set up the starting position and safely finish the set. For one exercise a machine with support might work best, for another light dumbbells. The program doesn't have to use only one type of equipment.
For example, someone might learn the machine chest press, do a supported dumbbell row, and perform bodyweight calf raises. Each movement serves a different purpose.
Check equipment limits
Fixed path isn't always convenient for every person. If you have to stretch to grab the handle or lose balance, check the adjustments or try a different machine. Free weights offer more movement options, but require better control.
In both cases, don't continue the movement through pain. And don't consider switching from one piece of equipment to another a simple swap of the same kilograms: available load and technique will change.
Save comparison option
Try the new format with light weight, then log equipment and reps. For progress tracking, compare several sessions of the same exercise.
If you're stuck with what's at home, start with what you have. Workout Programs lets you preview workouts and equipment before deciding what to buy.
Quick breakdown on video
Free weights or machines: how to choose
Watch video on YouTube