You approach a dealership or an independent mechanic because you're in need of an expert, but you don't know if this so-called expert is taking you for a loop, or being clean with you. The first step to protect yourself from unnecessary repairs is find information on what you do need, and what you shouldn't ever need.
Every car comes with an owner's manual detailing what maintenance services are required and when they are required. Automakers have agreed that you, as a car owner, do not need any maintenance beyond what is listed in the manual. While properly maintaining a car might seem expensive, it can prevent avoidable problems in the future. Many unnecessary repairs arise out of user ignorance. A good way to protect yourself is to accept that part of owning a car means paying for its upkeep costs.
This means, among other things, changing the engine oil at regular intervals, oil filters, air filters, brake fluids, rotating/changing tires, wipers, etc. according to the owner's manual.
What you don't need to do, ever, are services such as flushing out the engine or transmission. According to Consumer Reports, these are unnecessary services that are blatant rip-offs and could actually damage your components.
Other red flags include dealerships insisting that only they can perform maintenance if a car is still under warranty, and the frequent replacement of different parts. Both are violations of law. A well functioning car should not need frequent replacements of any vital part. These unnecessary repairs and services will cost you oodles of money and likely leave your car in a worse state than it previously was.
The second step to protecting yourself from unnecessary repairs would be to find a trustworthy mechanic.
Not all mechanics are sharks in human skin. Many are decent people trying to make a living. Odds are someone you know has an idea as to where you might find an honest mechanic. Customer reviews of various dealers and independent mechanics are all over the Internet.
A good way to determine whether or not a mechanic is trustworthy is to get a second opinion. Be sure the mechanic or dealership understands that you are going to be getting a second opinion and that you will hold them responsible for anything they might say (by contacting management). This will likely keep them a little more honest. Be sure to get written estimates of any mechanic you visit.
Keep in mind, not every item they advise you to repair or replace is necessarily a deception. There can be perfectly legitimate recommendations that your car may need. Protecting yourself from unnecessary repairs is all well and good, but neglecting a necessary repair can lead to further complications.