Some years ago, I became an undercover car salesman at two different dealerships in Southern California, as part of an investigative series for an automotive website.

While I posed as a "green pea" — the nickname for a beginner car salesperson — the sales managers freely revealed their secrets to me so that I would move the metal.

Here are just a few of the things I learned and how you can safely navigate the car-buying process.

1. Test-drive your car salesperson. I met many honest, intelligent, helpful car salespeople. But the work of these "good apples" was often spoiled by a rotten batch of uninformed sales stereotypes — not to mention some manipulative and even underhanded dealership managers.

I like to tell people that they should test-drive car salespeople before they test-drive the car. Here are a few things to ask yourself: Are they informed about the cars they are selling? Do they listen well and respond to your questions? Will you feel comfortable negotiating with them?

2. Check the 'book' value.

This one little data point would provide an amazing amount of protection. But as an undercover car salesman, I had to stand by and watch trusting, ordinary buyers overpay for their new cars.

So take a moment and check a pricing guide such as Edmunds or Kelley Blue Book for the current market value of the car you want. Bring this information with you.

3. Don't be a monthly payment buyer. "What kind of monthly payment are you folks looking for?" This helpful-sounding question is the favorite trick of car salespeople everywhere. While it sounds like the salesperson is concerned about your budget, it's the opening gambit for a tactic called "packing payments." Getting a preapproved car loan and telling the salesperson you are a "cash buyer" is an easy way to deflect this trick.

4. Be ready to walk. There is such a wide range of sales styles and dealerships.

I worked at a "turnover house," meaning that if one salesperson wasn't making progress with a customer, the customer was turned over to a different salesperson. If that didn't work, they brought in a "closer" — an overbearing, manipulative bully who was determined to make a deal at any cost.

If you see these warning signs, if you get a bad vibe, if you don't like your salesperson, go to another dealership. For example, the second dealership I worked at was very relaxed and didn't use closers. But high-pressure or relaxed, whichever type of car lot you find yourself on, never take anything at face value.

5. Beware the finance manager. While the salesperson negotiates the price of the car and pretends to be your best friend, the real damage is done after the customer is handed off to the finance and insurance manager. This salesperson assumes the air of a financial adviser, but he or she is really there to build even more profit into the deal by inflating the interest rate on your loan and selling you extra products such as extended warranties and anti-theft devices.

Before you go to the dealership, spend a few minutes being your own finance manager by using an auto loan calculator to set up your own deal. Bring these figures with you and get the dealer to match or beat them.

Philip Reed is a writer at NerdWallet. E-mail: preed@nerdwallet.com. Twitter: @AutoReed.