Buying my first car

I’m buying my first car today, already feeling bad about it, i have never spent this much money on myself and it feels wrong. What if the car ends up having lots of problems

Any advice?