Work on things that the firm values[1], for bosses who will reciprocate your work at making them look good, by making you look good.
Your manager has a huge amount of impact on your career. If you're working for an asshole/moron who won't reciprocate in this way, find a different one.
[1] Not the same thing as work that's valuable for the firm.