Cars are money-pits and unnecessary in most cities if you are willing to move to a neighborhood that is walkable with good public transit access.
If you must buy a car, it should be small, old, and ugly. Something you won’t give a shit about if it gets dinged, scratched or stolen. And buy with fiat - no financing/leasing/payments. Something like a cheap Hyundai or a 1985 Datsun.