How much do you value reliability?
Can you afford a reliable option?
These two questions should be in your mind when deciding which car make, model and year to purchase.
For example, I value reliability above anything else, and can afford a reliable option, so I buy only new Toyotas.
Where I live, in the new car market reliability is not for some reason priced in to the vehicle. A Toyota costs practically as much as an equivalent Peugeot.
However, for old cars the reliability of the particular make and model starts to affect the used car price a lot. So an old Toyota is not a better purchase than an old Peugeot because the reliability is "priced in". But if purchasing a new car, it would be foolish to choose anything other than a Toyota.
If you decide that your purchase was a mistake, and can afford a non-mistake, cut your potential losses, sell it and buy a more reliable car to replace it.
If you on the other hand cannot afford a non-mistake, you should start to create a budget for how to keep the car in a running condition. Do discard it when it's so broken that it doesn't make sense to continue driving it. Generally, for someone who does not value reliability, the cheapest miles/kilometers can be obtained with a used car and not with a new car. The miles/kilometers are not risk free, however.
Also, an option to consider. A long, long time ago I purchased a used car that was a mistake. Got rid of it and replaced with the smallest new Toyota that was available. I essentially admitted I did a mistake, and decided to move to a much smaller car because I couldn't afford a new large car. If you physically fit into a small car, consider such a car: the smaller the car, the cheaper it is to purchase and to run.
If you decide to change your car, do replace it with something that is much more reliable and much newer. It doesn't make sense to purchase car of year X, then admit you did a mistake, purchase car of year X+1, then admit you did a mistake, purchase car of year X+2, and so on... So do move to a much newer and more reliable car, if you decide to change your car.