Be someone other people like to work with and politics take care of themselves. Do your best to make other peoples' jobs easier, from the users you are developing for to your leadership and peers to the people who work under your leadership. If things are going sideways, communicate that. At the end of the day, it's a team effort. One chair leg can't do anything by itself, but four of them hold up a seat, and the seat can carry a heavy load. That's my goal.
I know it's not like that everywhere, and I count myself lucky every day to love my job.