As a rule, I only listen to cats that are stronger than I am. Some names off top that I listen to are: Omar Isuf, Jeff Nippard, Alan Thrall, Jim Wendler.
There are also two cats I take tips from on NikeTalk's gym thread.
As for whether I follow a program or gym as I go, it's both. I'll usually take a program that aligns with my goals, review it, see what results others have gotten from it, and then run it as is or modify it suit my needs better.
Never gone completely off script (i.e. fukkarounditis) since I started lifting; it'd be pointless to completely program my own workouts as a beginner, since I didn't have a clue as to what I was doing. I don't really program too much now since I'd have nothing to compare them to as far as efficiency and success. IME the guys that go in the gym and have no plan are either guys that have already arrive and are just tryna maintain, or clueless fukks who'll never make it.
I might be in the minority here, but I tend to only take advice from fitness pros: BBers, coaches, PLers, Oly lifters, fitness competitors, etc.
The biggest gems I've learned and taken to heart are:
1)
"Consistency is key." This applies both ways: if you're consistently killing it, the results will show. If you're consistently

your results will also show. My mentor/nemesis from work taught me that. It applies to things outside the gym as well (most gym lessons are life lessons too

).
I always think about the gym regulars and split them into two camps: the Haves, and the Have-nots. The Haves will consistently show up, put in work, and be on their shyt to do it again. They don't make a bunch of excuses, fukk around wasting precious time, or bullshyt their training. Their workouts are structured and fundamentally sound. These are the guys/gals that have "auras" in like it's DBZ in the gym. They get stronger, leaner, bigger, and people are obviously impressed with their progress.
The Have-nots are the opposite. They show up regularly too, but they never seem to make measurable or visible progress. I've been going to the same main gym for like 4-5 years now and the Have-nots that are still there more than a year or two still look the same. They don't have auras, they just occupy space. They don't get any leaner/bigger/stronger, whatever like a gym regular should.
Their workouts are random or poorly structured, usually based on iso's and machine work, they don't tend to go very hard, and the workouts are over quickly. I can see just by looking at most their diets are trash (pot bellies and/or booty-do's but you gym 4-5 times a week or more), or the little fukks that can never seem to bulk right.
2)
"Never take strength training advice from someone who is weaker than you." Once I learned this lesson, it became easier to filter out the good from the bad advice on YT, Internet forums, fitness websites, IG posts, etc. This applies in the gym too. Muhfukkas that can't squat or bench or deadlift anything near what I move will say shyt like: you shouldn't use a belt, you shouldn't train that long/frequently, you should do X. I hit their asses with the

because listening to a nikka that hasn't gone where you've gone is pointless. I wouldn't take advice on money management from a broke boy, or sobriety tips from a drunk. That's hustling backwards to me.
Thus, I automatically tune out cats like Meth and 50 when it comes to working out since their feats are not higher than mine. As a rule I never take fitness advice from regular gym cats or celebrities.