Buying a Faulty Used Car

Buying a second hand car is stressful and expensive but where do you go if the car develops a fault? Do you have any rights?