The other top level comment explains the advice very well:
The reason the advice "be yourself" exists, and also why older people tend to be the ones expressing it, is that the danger in not being yourself is that you may wake up one day in a career or surrounded by people that do not accept you for who you are. And you end up trapped in a life where you have to pretend to be something you're not. The idea is that the younger you start being honest about yourself to others, the sooner you will wind up away from people that do not like your true self, and closer to people that appreciate you for that true self.
If you are an introvert, do not spend your life trying to pretend you are an extrovert. Instead, embrace your introversion and find a sustainable way to get the social interaction you need/want.
If you do not enjoy managing people, you will fall behind people who do enjoy it, so instead spending your years unhappy and trapped, try to find a career ladder where you can focus on being a great individual contributor.
If someone close to you just died and you are grieving, do not try to pretend that you're fine or cheerful for the sake of others. Take the time to process it however you need to.
There are plenty of other examples. This advice isn't really about how you act day to day, it's about making sure you are doing things for reasons you actually believe in.