The costs of a car that are not the payment
Insurance, fuel, tyres, depreciation and repairs decide what a car really costs. The payment is the part you already know.

Two cars with identical monthly payments can differ by thousands a year in what they actually cost to run. The payment is the visible part.
Insurance is the one that moves most, and it varies by far more than people expect between cars that look similar. In California it is worth getting a quote on the specific vehicle before you commit, not after — performance variants, expensive repairs and theft rates all show up here.
Fuel or charging is arithmetic you can do in advance from your real annual mileage rather than a national average.
Tyres are the quiet one. A car on large, low-profile, performance-rated tyres can cost several times what a conventional set costs, and wear them faster. Look up the size and the replacement cost before you buy, not when the first set is down to the wear bars.
Maintenance and the shape of the repair curve matter more than the first service price. Ask what the scheduled services cost at the intervals the manufacturer specifies, and what the known expensive items are on that model.
Depreciation is the largest cost of all on a newer car and the one nobody writes a cheque for, which is why it is ignored. Two cars at the same price can differ enormously in what they are worth in three years, and that difference is real money whether you sell, trade or hand back.