The idea behind cayenne pepper is that the smell is repellent or else it makes the dog sneeze when he sniffs around prior to digging. However, it's debatable whether this works or not. There's little to lose by giving it a go, but don't be disappointed if it doesn't work.