Serious answer - and I am leaving out flash-in-the-pan politicians and concentrating on the serious kind: The first thing you do is get involved in your community. Find things that need fixing and come up with possible solutions. Develop plans. This involves talking to a lot of people and convincing them that you, personally, are a person that can get the job done, and can convince other people to help you get the job done. It is advantageous to know the limitations of the position that you are trying to get elected for in this respect.
Next, you run for an office. Generally best to start local, such as school board, state delegate, alderman, mayor, whatever. This is where the tactic of kissing hands and shaking... I mean, shaking hands and kissing babies comes into play. Get to know the people who would be your constituents. Tell them your plans. More importantly, let them get to know you, so that come election day you aren't just a random name on the ballot. Random names only win if the known names suck.
And there you have it.