The tricky part is that a lot of this advice is situation-dependent. Should you switch to a riskier company that offers a higher compensation? Sometimes yes, sometimes no. Should you work late to accomplish goals hoping to get a promotion? It depends.
So how are we supposed to know what to do?
The answer, in my opinion, is people. You have to trust people who are trustworthy and avoid people who are not. As an employee, your success depends on the people who hired you--they are the ones who can promote you or cheat you. The best leaders are the ones who realize that helping you advance is going to help them advance. Help your boss accomplish their corporate goals and they will promote you--not as a reward, but as a bet that you will help them on the next goal.
Bad leaders are either too selfish (fail to promote you) or too incompetent (unable to rise, even with your help). You need to learn to avoid them.
Therefore, my advice is this: Look at the leaders in your company--people who could plausibly hire you. Which ones are the best bets? Which ones have both the talent and the integrity to succeed? If you're lucky there's more than one and you can work to get on their team. If you're unlucky, there are none and you need to find a different company.