Do all the research stuff people have suggested. Keep in mind that there is one, and only one, hard number from which to work - the MSRP on the window sticker. No, I do not mean you should pay that amount, but it is the only consistent number the dealer will let you see, and then only because he/she has to. A dealer's "invoice" is worthless and can be ginned up to say damn near anything. Even if the "invoice" is legit, it often will nto reflect rebates or othe promotional deals the factory gives to the dealer. By contrast, he MSRP must be the same for all cars of the same make, model and equipment. So when calculating how much to pay, start with the MSRP.
In any negotiation, and especially with car negotiations, you have to be prepared to walk away. If you aren't, you will be had. Figure out your "best offer" price ahead of time, and walk if you can't get the car for that. (Walk away slowly, so as to give the salesperson a chance to chase you down with a "final" offer - I have had salespeople do this with me, although they never hurled shrubs at me ) If you can't get the car for your "best offer" price at several dealerships, you may have to readjust it upwards a bit or aim for a different car - more popular cars can go for more than the sticker price, some go for a bunch less, and it isn't an exact science.
If you are in a negotiation situation (as opposed to where the credit union finds the car and best price for you), be prepared to actually negotiate. Don't try the "I know you'll sell this car for $X below sticker, so let's just cut to the chase" approach. Psychologically, they have to try to get you to pay more. Start below your "best offer" price and let them work to bring you up to it (or maybe even less than that). It sounds (and feels) kind of dumb, and I can't explain why it's true, but experience says it is true.