I'm the designated car buyer for a few people. (this advice is US centric)

First off, the market right now is really terrible for buying. Possibly the worst it's been in a really long time. The same things that worked before, still work just as well as they did before, but the price you up with at the end is a lot more than it would have been two years ago.

The first thing to do is to decide on the Year/Make/Model/Trim/Options you want. Treat this as a separate search from actually purchasing the vehicle. If you want to, go to place that has lots of vehicles, like CarMax, and test them out, one after another. You may be happy with several different trims / makes, in this case just make a spreadsheet of how much more or less you each would be worth for you, and adjust the prices you get later in your search accordingly.

For every vehicle I've needed to buy, somewhere there is an old-school, year 2000 era bulletin board full of enthusiasts for this kind of vehicle. There's always a forum thread called "How much are you paying", in which people post detailed breakdowns of how much they paid and the eventual out the door price. There might also be Facebook groups that are similar. Go through these purchases and make a spreadsheet of the ones similar to what you want to buy. There's going to be a big range, from clueless newbie fanboys massively overpaying to seriously good negotiators / really lucky people. I tend to target about the 20%-30% percentile of these as my target price. Given that there are plenty of good negotiators in these communities, and people are more likely to post good deals than bad ones, this works out to paying far less than your average car buyer.

Next, look up five to ten dealers nearish you that have the vehicle you want. By near, I mean I usually search about a two hour radius, which hits several other metro areas. Then, first check their ads for discounts, then fill out a web form and ask for pricing on the vehicle you want. If it's not out the door pricing, email back and ask for it. Spreadsheet your answers!

Here's a couple truths about car dealers.

First, you aren't negotiating against some kind of magical invoice number, and that's not the metric of how well you do at negotiating. The car dealer is judging if they will make more money selling to you (and thus increasing how fast they turn over vehicles) than they will holding onto it, and selling it to someone else for a higher price. (after all you will only be willing to pay a below average lower price) However, where a given dealership is on that spectrum of how fast they want to sell will vary quite a lot. Maybe they have been selling out right away on a particular vehicle, even with higher than usual prices. They aren't going to budge a bit. All the negotiating in the world isn't going to do any good. This is why you need to be poking at lots of places. I've always found that at least one place is willing to sell for much lower than the rest.

The second thing to know is that car dealer are negotiating for their total profit on the deal. This means that they are taking into account how much profit they are getting from the trade in, from financing, from fees, from stupid overpriced accessories, etc. You have to think the same way as well. If you just negotiate an amazing "price" for your vehicle, then trade in for too little, and pay a couple thousands in fees, you've left a lot of money on the table. I tend to line up a price I know I can sell the previous vehicle for via carvanna or looking up private party sales before I start my dealer rounds. I mentally work in out the door prices then using their trade in price if it's better, or not if it's worse, across dealers.

The third thing to be ready for is that the majority of dealers lie. Its unbelievable how much I'll get lied to during a search - bogus facts about the vehicles I'm buying, made up things about state laws, "every dealer charges this" for outrageous extra fees, and everything else under the sun. By working across many different dealers, this becomes less of an issue except for your blood pressure. Just put a big lump of baysian uncertainty around every word that comes out of their mouths. Dealers will also bait and switch, some even so far as giving you a written out-the-door price, then raise the price when you get there to purchase. I've had this happen to me after an hour a drive, and another time after an hour and a half drive. Raise a big stink if you have it in writing. One place eventually gave me the price. One place didn't, and I didn't buy, and I bought somewhere else for the price I was looking for.

I've found that some dealers are good at making deals online or over the phone (and most purchase I've made have been with this kind), but many really only want to deal face to face. Quite a few dealerships will not give you a discounted price in writing, because they don't want you to shop around with it. If it's not too far away, just show up, talk see what you get, and leave if it's not good enough. Your superpower is leaving if it's not good enough.

When you are in a dealership negotiating, I've never met one that would just deal. They want to play their power games. It's going to be a ten or fifteen minute round trip each price change, while they do their scripted routines, first with the salesman going to the back for a while, on each change, and then eventually, inevitably with the sales manager coming out to you.

It's almost stupidly easy. You have a target price. You've already talked to X number of other dealerships and know what you could pay there. When they give you a price, if the total out the door price is too high, just say you were looking for more like your target price, and ask them if they can do better. Fifteen minutes later, you'll get a better price. Or if they tell you they can't go any lower, you get up and start walking, and sixty percent of the time, they can go lower.

Also, an easy win after the first round of the price going down is to negotiate the removal of the stupidly priced dealer accessories. Most will look like you have suggested murdering their grandmother, but 50% of the time, they will lose the accessories.

Anyway, I've always hit my target price. No special negotiating other than just saying that price isn't good enough, sitting there, and walking out the door if they stop lowering the price before you hit your target. If you've never done it before, just go to a dealership once for a vehicle you don't care about, and just practice it.

The overall secret is to have lots of dealers, which gives you lots of options, which lets you say no to bad deals, and inevitably, eventually, one dealer can give you a good offer.