Animals in general have an impressive ability to perceive smells.
Some scents seem pleasant to them, while others are disgusting.
The second category of smells can be safely used for "pedagogical" purposes to wean your pet from unwanted behavior.
Few people know that this plant can seem simply disgusting to cats due to its smell. Thanks to rue, many experienced gardeners protect their plots from neighboring cats in the most humane way possible.
The aroma of the plant can also drive away snakes.
It is not surprising that cats find the smell of onions very unpleasant. Onions should be used raw: rub them on any area that you are trying to protect from your pet.
These scents can also be safely used for "educational" purposes. Cats will not approach a place if it smells of vinegar or citrus fruits.
If we are talking about citrus fruits, you can even use the peels.