If you get a model of car when the new model comes out, sometimes you can get a great deal on a new car. It's very rare though, because usually the lots keep their older stock priced up anticipating people wanting a "deal" on the old model cars that "must go".
In my experience, it's almost always best to buy a used car with around 5-15k miles, provided it's a decent car to begin with, has a decent, proven resale, and is in brand new condition. One other thing I noticed is that (if buying from a lot), the used vehicles that are not of the same make as the dealer are usually more reasonably priced. I think it's because people go to dealer A to buy a car of type A, and thus, they can charge a bit more.
I have owned 8 new cars and several used throughout my still short lifetime, and I took a hit on every single one of the new cars except for two, which were make B that I got from dealer A, and were going out of style. The same late model (new) cars that "must go" from dealer B were a few grand more.
Never pay more than invoice on a new car. Their "sticker price" is a joke. Their invoice prices already include profit for the dealer.
As for purchasing from private parties, I found it to be too much of a hassle. People tend to think their car is worth more than someone elses identical car. By the time I found a good deal, on a good car, that was in good condition, it would have turned out better for me to just buy it from the start for 1k more, rather than waste the months looking.
It's all anecdotal, so take it with a grain of salt.