The cost of a vehicle is composed of the following:
- Purchase price, or down payment if financed
- Taxes and fees due at closing
- Monthly payments if financed
- Insurance costs
- Maintenance costs
- Taxes and government fees (vehicle registration, etc)
If you're in the US, you can deduct many of the costs above on your income tax returns, but most people simply take the mileage deduction, which is rather generous at $0.56 per mile for 2021. Deducting actual costs requires itemization and calculating depreciation, but the mileage deduction only requires documentation of the miles driven for business purposes. A simple log book will suffice.
There are lots of tradeoffs to be made. For example, a new car is far more expensive up front, but maintenance will be lower. It should be zero except for expendables like tires, batteries, etc. during the entire warranty period. Maintenance on a new car should be little more than oil changes, replacement tires, etc.
Financing also has a lot of tradeoffs. You'll be required to provide collision and comprehensive insurance, which can be expensive depending on the car, your age, your gender, and your driving record. If you're a single male under 25, anticipate it to be quite expensive. However, going without that insurance coverage, particularly comprehensive, is a risky bet. Somebody steals your car? Tough luck, you're out the money. Ditto if you skip collision insurance, you damage the vehicle in a crash, and it's judged to be your fault or the other driver is uninsured. If you've also got some moving violations on your record in the last few years, expect it to get more expensive. If you have major things like a DUI charge, expect it to be almost impossible to obtain insurance at all.
If you have a good credit record, auto manufacturers often offer very attractive financing options on new (and sometimes "certified" used) cars, sometimes even 0%. But don't expect to negotiate much off the purchase price if you're depending on dealer financing.
So how do you find out all these numbers? First, decide what sort of car you need, then go online to some of the car sites like cars.com, Edmunds, etc. Get an idea what vehicles best suit your needs and what they cost. Then call or go online to at least three insurance companies and ask for quotes on those cars. If you're going to need financing, go to any of the financial sites like bankrates.com and find out what new and used car loans cost.
Don't forget used cars. This is likely to be your best deal, but buyer beware. How much do you know about cars? You can get some great deals buying directly from another individual or dealer, but if you don't know a reliable mechanic who can inspect it for you, you need to find one first. Add his fee to your cost (should be 1 hour of his standard rate).
The absolute last place you should visit in your research project is a car dealership. Trust me, they spend their days selling cars to unknowledgeable people, and they will win if you haven't done your homework. They will lie to you. They will stroke your ego. They will tell you that you have to make a decision today, which is just another lie. Don't get near an auto dealership until you're kind of an expert on the car you want to buy.
NOTE: I ignored leasing options in my answer because those can get very complicated and are rarely a good choice unless you expect to keep the mileage low and plan to replace your car with a new one every few years. It doesn't sound like that's what you're looking for.