First, if you don’t know what you are doing, really, get a trainer and tell the trainer you are serious and that the trainer should be serious or they’re fired. Make sure you get a good trainer. Tell the head trainer that you want a good trainer. Ask around about who is a good trainer. Seriously, a lot of trainers suck. You don’t want to pay for a bad trainer.
Then, work with the trainer for a few weeks, with the stated goal being to learn to use the machines and free-weights properly. If the trainer resists and wants you to have a different longer term goal that involves the trainer (thus hiring that person for more time) get a different trainer. Or, if you have piles of money or don’t mind going into debt for this, use the trainer long term. But really, the trainer should be a teacher and eventually you should graduate.
Second, do it right. From a trainer and from professional books (and not your friends or some dumb-ass blog) you can find out how to do the exercises right and to put them together into effective routines. There are three ways to do any exercise: The right way which is safe and effective (and there may be more than one right way, but usually not); the way which is safe but not effective (so why bother?); and the dumbass way, in which you may injure yourself, which is rather counterproductive.
One way to find out how to do something wrong is to watch the people, usually guys, at the gym who are wearing braces and such. Those giant leather belts around the middle of the body are there because the guy hurt himself working out. Watch how he does things. Then, don’t do that.
One common way to do it wrong and cause injury is to think that moving the weight is the point, rather than working the muscle. You are on the bench and you are going to try to press a heavy weight on a bar. You start to press the weight but your chest and arms are not doing it. So you arch your back. That will help move the weigh because now you have a third lever working on the problem, with your shoulders at the fulcrum and your torso as the lever. But that is not doing it. So you swing your legs up a bit using your ass as a fulcrum and your legs as a lever, and this pops your torso up off the bench, so that lever is now adding more force to the lift as you wave your body in a convulsive pattern, and up the weight goes. And, you are a dumbass because you pulled a muscle in your lower back and slipped a disk and ripped a rotator cuff all in one shot because you forgot one of the main objectives in working out with free weights and machines: Isolate the muscle you are working on and safely, systematically, stress it.
That is all.