As with all things work related, you should have clearly stated objectives. If you know what you want to achieve you can better befriend the right people and prioritize your efforts so that whatever you do is leading you in the direction of your goals.
When it comes to office politics, the same applies. Pick your friends -- and your battles -- wisely. Don't get sidetracked by the game, focus on the prize.