I can say with great modesty that I'm my boss's favorite at work. I'm the person he turns to when he's in a bind. Every boss wants this type of person to be around them. You are not your boss's assistant per se, but you are the person on the other end of the big bright red flashing alert button. That's what constitutes being a favorite, not being a sycophant.
All importantly, don't equate being the boss's favorite with being their "slave". Always walking on eggshells around them and constantly praising their actions as if they are omnipotent is no way to gain favor. The boss likes to kick these people around. These people have a purpose, but by no means does the boss regard them as as equals.
And that's my second point: the boss regards people he admires as his equal in many respects. He realizes that you might have skills that they don't have and your are a way for them to tap into this resource. Make yourself a commodity and the boss will be endeared to you.
Always putting forth 110% is crucial to gaining the boss's favor. Most bosses are high achievers and therefore respect those below them to go above and beyond.
Developing new ideas for the business and relating them to your boss will certainly gain favor. Bosses are high achievers, but they are also visionaries. If you don't present new ideas, your boss will not consider you to be a confidant.
Standing up to your boss, respectfully, is a great way to gain favor. Bosses don't always want people to push around; they want to be rebuked. Develop the courage to stand up to their ideas, and in turn they will develop great respect for you.
Become "friends" with your boss. Learn their interests and discuss current affairs with them. The more of these moments you have together only solidifies the relationship.
Become the go-to guy. Bosses always have too much work, but in order to relieve some of the load they must have someone they can trust to do the work to their specifications. If you can do this, the deal is sealed.
Just doing the ABCs of work (being on time, not being late, not being absent) just won't cut it. These a expected and by no means should be praised.