The best way to get a dog to stop chasing cars is to train it with positive reinforcement. Start by teaching your dog to sit and stay when cars approach. Reward your dog with treats and praise when it complies. Additionally, you can use a leash to prevent your dog from chasing cars. If your dog continues to try to chase cars, you should consult a professional dog trainer for more help.