Dogs don't do anything that doesn't work for them. Evidently the barking is rewarded at some point. If he barks when getting out of the car, he may have learned that the barking made him get out of the car. So you have to take away the payoff. If he barks, immediately put him back in the car (don't say anything) so he gets the opposite result of what he wants. Wait until he is quiet and then get him out. repeat as long as needed. This is just an example and you can use this technique for other situations. It is basically asking yourself "What is his payoff for annoying behavior?" and then give him the opposite consequence.
Example: once I was prepping an 8 week old pup's meal on the counter. It took too long according to the little guy and he barked. I immediately picked him up, put him behind a closed door for about 5 seconds. Got him out, fed him. He never did it again his entire life. Undoing a habit takes longer btw.
Deja, GSD, sable WL, female, born 11 / 2013
Cam, Rough Collie, sable, male, born 8/2015