Partially through trial and error, partially from other people, partially from books, etc.
It's not so much that "these young kids won't listen" that's annoying, but this mantra of "we're all here to learn from each other - that's how we grow!". Except... if it's me. Then you choose not to learn from me. Or older people in general. Just drop the "feel good we're all a team" facade, because it doesn't represent what you're actually doing. The disconnect is the problem, not the actual behaviour.
When I was in my 20's, my mentors were all 50+. And, quite often, I would have to hit the wall before the good advice they gave me made sense. I realized later that I was really irritating to them at many points. It took me, like, 4 times hearing "You might want to think about that" from my main mentor before I started mentally translating that to "Dumbass. You're about to hit the wall. Again."
I am not a smart man.
They stuck with me because the magnitude of my vector was large (ah, the province of youth--boundless energy), so, even if I had a significant amount in a useless direction, I also had a significant chunk in a useful direction. And I would learn--I rarely made the same mistake (but I was quite good at making new mistakes ...)
However, if the people around (not just the kids) really don't understand that you're an expert at what you do, you really should think about getting a different job. If the consultants are willing to pick information from your brain, that's a good sign that you really do know what's going on. In return, you should make use of their people network--poke at the consultants you think are good. And right now is a good time to be making such a job change.
Ageism is a thing. On the flip side, the number of greybeards in this field continues to increase year on year--the people who learned computers as kids in the 1980s are now hitting their 50s.
It's not so much that "these young kids won't listen" that's annoying, but this mantra of "we're all here to learn from each other - that's how we grow!". Except... if it's me. Then you choose not to learn from me. Or older people in general. Just drop the "feel good we're all a team" facade, because it doesn't represent what you're actually doing. The disconnect is the problem, not the actual behaviour.