I think the most important rule is to listen to your body and to take everything anyone tells you inside a gym with a grain of salt. There are good personal trainers out there, but the vast majority will just scream at you to do 3 extra reps at terrible form. People in gyms often have personal biases (which is fine, I do sumo deadlifts and can't stand regular ones) and their advice/preferences might not work for you or might be outright stupid. Lifting weights alone without prior experience is a bad idea and you're probably better off with a personal trainer for the first few months. However, nothing compares to having a buddy who's dedicated, but not a meathead.