If your car has been involved in an accident or it has suffered mechanical damage, then you need to weigh up the cost of repairs compared to the value of the car. If your have been involved in an accident, your insurance company will ask you to take the car to an approved garage to have an estimate done. If the estimate comes in between 50% – 100% value of the car (depending on age) then they will probably not authorise the repairs and will write the car off.
If the car has mechanical damage then it is up to you as to how much you spend on it. You will first need to assess what the problem is and then get a quote to fix it. Always allow a little bit extra for labour and check with the mechanic as to if they are sure that what they have quoted for is all the work required. With scrap prices quite high at the moment, you can get quite a bit for even a very old vehicle and if you are willing to sell it for spares and repairs then you can get even more.