They are better at keeping them away after you’ve gotten rid of them, than getting them to leave. Here’s what worked for us: https://www.frugalfamilytimes.com/2018/10/how-to-get-rid-of-mice-rodent-proofing.html?m=1
I have not found those to be successful.
Mine worked at keeping them out once I had trapped several.
I once had squirrels in the soffit. I actually ran an extension cord through the access hole to the attic and left one plugged there for an extended period, while also plugging them to outlets around the outside wall (indoors) NOTHING STOPPED THEIR PARTIES. Have since renovated and resided all the rot and access they so dutifully bring to our attention, which also attracts carpenter ants, who like moist environments and remove the rot and shine it off (but do not eat it or eat good wood, like termites do).
The only time I had mice enter, was if they could get up under siding to come over the foundation brick. But that was very rare and my cat was thrilled. In some situations, one can use expanding foam to seal an entrance point, BUT it cannot be left exposed to sun and outdoor elements, Inside may end up with a pile of foam where you do not want it.