1) Start slow and ease into it. Start out each exercise session by warming up and then slowly increasing the work load. This concept also applies to taking your first few workouts a little easier and not giving it 100 %. You don't need to do 3 sets of each exercise the first time you work out. Many people go so hard on the first day that they get sore and regret it.
2) Get familiar with the equipment. Some people jump on a machine and start working out without adjusting it to their body size or the appropriate weight or resistance. Make sure to customize the equipment to your body size and needs before you use it.
3) Create a balanced work out. Don't just work out your "mirror muscles". Many people focus on building biceps, pecs, and abs but neglect major muscle groups like their back or hamstrings. It is healthier to take a whole body approach even if you have specific body parts you'd like to focus on.
4) Focus on form not weight. I have seen people (usually young guys) trying to curl more weight than they could possibly bench press to show off or compete with others in the gym. Not only is this ineffective, but it is dangerous and makes them more susceptible to injury. Use a slow and controlled movement when you move the weights. Don't increase the weight on an exercise until you can perform it with proper form. Be careful not to just mimic what others are doing since so many people at the gym have horrible form.
5) Breathe when you lift. Don't hold your breath, that could cause you to pass out. Your body needs oxygen. Learn to exhale during the most strenuous part of the lift. It does not seem natural to breathe out at the point of greatest exertion, but it is a good habit to develop.
6) Use a spotter. This is especially important as you are beginning to use free weights. Until your muscles have developed the motor pathways, free weights may be a little shaky at first. Utilize a spotter for proper form and safety.
7) Give your muscles time to rest. Don't work the same muscle group without giving them time to rest and repair. Muscles need about 48 hours to recuperate. Your muscles actually grow and rebuild when you rest them. Over working a muscle group can cause muscle fatigue and can lead to over training.
8) Find an environment you enjoy. Some people thrive working out in a gym , others prefer the privacy of their home, and others enjoy outdoor activities. In addition to the finding the right environment, you will want to do exercises you enjoy because they will be more fun and you are more likely to stick to it. One final idea for increasing your chances of success. Work out with friends. It provides a social aspect to exercise and it gives you greater accountability.
9) Use basic gym etiquette. Don't drop weights and remember to re-rack them when you are done. Don't hog the exercise equipment. Let people work in with you if they are waiting. Clean up after yourself by wiping off any equipment that you may have "moistened". My biggest frustration: keep the noise level down. If you really have to grunt and groan during your workout you may want to re-evaluate your program. I once saw a guy curling dumbbells and screaming at the top of his lungs. He got plenty of attention which I'm sure was his primary reason for going to the gym, but he irritated everyone else there.