If the defect existed at the time of purchase, even if it was not obvious at first glance (so-called hidden defect), the seller is liable for it. Whether you are entitled to a refund depends on the severity of the defect and whether it can be repaired. For serious defects that significantly reduce the car’s value for money, or that you would not have bought the car in the first place, you can cancel the contract. Minor defects usually entitle you to claim a repair or discount.
It is also important whether you bought from a business (car dealer) or a private individual. When buying from a business, the consumer is also subject to special protection under the Civil Code and the seller is liable for defects that become apparent within 24 months of receipt. In the event of a dispute, it is worth having a professional opinion to prove the defect. The sooner you claim the defect, the better.