If it's in a space you can access, there are battery operated squirrel/rodent repellents that flash strobe lights and make a sound that's inaudible to humans.
Both the lights and noise make it too uncomfortable for them to live there:
https://www.amazon.com/Glaobule-Electronic-Repellent-Ultrasonic-Deterrent/dp/B0814VJ7Y6
As I mentioned in a previous comment, they hate the smell of apple cider (and also ceyenne pepper).
I ordered two of these.
They are 20$ and take 3 AA batteries. I didn’t zip tie them anywhere under the hood and just keep them on the garage floor on 24/7. It emits lights and high frequency beeps. I was expecting them to break easily or not work but I haven’t had any rats at all since I got them. Additionally I regularly patrol my yard abs garage and remove all food sources. I also ordered spring traps for cheap and bait them with raisins in strategic places.
Yea it's an ultrasonic rodent repellent. https://www.amazon.com/Glaobule-Electronic-Repellent-Ultrasonic-Deterrent/dp/B0814VJ7Y6