You can also buy rat repellent and spray it around the tires and under the engine, which can also drive away rats.
Once you find rats in the car, you should first check whether there is any damage in the car, and also check whether there are problems with the lines and pipes in the engine. You'd better go to the car wash shop for a thorough cleaning. If the parts in the car are damaged, they need to be repaired or replaced in a repair shop.
It is necessary to keep the car clean and hygienic at ordinary times. Remember to close the door when you get on and off. Don't leave the snacks that mice like in the car, and it's best to stay away from the trash can when parking, because this is where mice often haunt.