Actually, the profit a dealer makes on a sale is usually not too significant compared to the taxes and other fees you pay for a car. Most states charge 6% to 8% sales tax and states like California, Washington , Minnesota and Arizona also have license fees based on value so you could be paying more for your license plates than the dealer is making on the sale.
The overwhelming costs to own a car comes down to two things...cost for the money and depreciation. What that means is that you should choose the car you buy with the idea that you are going to keep it for a long, long time. Pick a car that has everything you want on it and which will keep you happy for a long time and one that will last for a long time (Lexus, Mercedes, etc.)
Even if you pay cash for a car, you still have to account for the lost income from that money.
These are the facts of car ownership and the reasons why American cars are lousy buys. They have poor resale value which effects short term ownership and they don't last too long which effects long term ownership.
Assuming you do keep a car for a long time, you needn't worry about buying a car at the end of a model run.
BTW, the cost of maintenance is pretty insignificant compared to the cost of money and depreciation. In fact, maintenance is a good investment.
On the other hand, the cost of insurance is something to think about.